Cannot delete measures within a multi-measure rest

• Dec 20, 2013 - 07:13
S2 - Critical

I turned on "create multi measure rests" in the style and have an N-measure rest at the end of my score. I'm done so I want to delete these trailing measures. Selecting the rest and saying Edit -> Measures -> Delete selected measures does not remove them.


MacOS 10.8.5


Worse - it deletes the *first* measure. I'm marking critical since this could lead to loss of data if you didn't notice what was happening in time to fix it with Undo.

Workaround is to turn of the multimeasure rests and delete the measures that way, then turn it back on. And actually, under normal circumstances, this would never come up. One normally enters notes into a full score then views parts, and othe score would not have mm rests turned on. You'd normally have removed any excess measures within the score, probably before even generating parts. So it's perhaps not *quite* as critical as it might otherwise appear.

Status (old) active patch (ready to commit)

The reason this was an issue is the difference in data structures for measures containing multi-measure rests.

Deleting the measure displaying the multi-measure rest causes all the measures covered by that rest to be deleted.

It might be sensible to go right through the code to change use of lastMeasure() (for example) to lastMeasureMM(), &tc...

It's arguable that delete a multimeasure rest measure should delete all the covered measures. If you have a score with 2 linked parts and only one part has music for 8 measures and you are currently viewing the other part, deleting the multi measure rest measures *will delete* the content in the other part (and in the score) ! Do we really want to make this that easy?

Good point, I hadn't thought about that. What does it currently do in such a situation?
What would you like it to do?

As far as I can see it could

a) Refuse if there's a linked non-rest part
b) ask
c) errr... something else

Status (old) patch (ready to commit) needs info

So, what to do?
What seems to me most sensible in this instance of deleting a measure containing a multi-measure rest is to check associated scores for music, rather than rests, and if found notify the user and ask if it is acceptable to delete measures. Should I prompt the user for "just this part" or "both parts"?
It seems to me that if there is no user then there should be no deletion.

Status (old) needs info patch (ready to commit)

I'm not normally a fan of disallowing things unnecessarily, but when I think about all the implications, I'm almost inclined to say, simply disallow deleting measures in parts, period. That is, not just multimeasure rests, but ordinary measures, too. It's a bit scary that you can delete something you aren't actually seeing. It would really be safer if deletion of measures took take place in the score only. And in that case, multimeasure rests would normally be off. but if for some odd reason you had multimeasures enabled even in the score, then I'd say, let deletion work normally.

If people are opposed to disallowing deletion of measures while in a part, then I'd propose adding a confirmation dialog (another thing I generally don't like). Again, I think we should not special case multimeasure rests. Deletion of *any* measures is dangerous in a part, because you are also deleting things in other parts that you can't see.

Sounds good to me.

I think the deletion of mm rests needs to be handled properly, otherwise someone will deface their score sometime, and it's a really quite short fix.

Preventing deletion of (any) measures in a part sounds like a good idea to me, too. A message giving the reason should be sensible and sufficient, d'you think?

"Undo" is enough of a safety net for successful deletion, I'd say.

Yes, definitely, in settings where it is decided deletion of measures should be allowed at all, it needs to not delete the wrong measures!

As far as I am concerned, the issue of whether or not to allow deletion in parts at all is totally separate - I'd have exactly the same reservations even if multimeasure rests had never been invented. So my vote is, fix the bug with deletion of multimeasure rests first. Then as a totally separate thing, maybe look into also disallowing deletion of measures (or asking for confirmation) while in a part.

In which case the patch as supplied is still ready to commit.
It works no worse than the current situation in multi-part scores.