Iterating over elements with Alt+right in score with MM rest shows weird barlines, crash is possible

• Feb 21, 2020 - 12:03
Reported version
3.4
Priority
P0 - Critical
Type
Functional
Frequency
Once
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project

1) Create a new score.
2) Turn MM rests on.
3) Start iterating over elements with Alt+right.
Alternative: select the last bar line and press Alt+right.
Result: at the top of the page barlines with grips are drawn. Trying to drag those grips leads to a crash.

This is a partial regression in 3.4 version: in 3.3.4 those barlines were selected (which doesn't seem like it should happen) but were not shown and did not make it possible to crash MuseScore.


Comments

I'm preparing a PR to deal with the navigation issues, I'm finding a few places where we can incorrectly navigate into mmrests. That should keep us from getting into this situation. I don't know the code dealing with edit handles so well, if someone else want to try to add sanity checks to prevent crashes if we do somehow still find ourselves with an element selected that is not in fact valid, be my guest.

Status PR created fixed

Fixed in branch master, commit b5d53248ab

_fix #301436: invalid selection when navigating with mmrests

Resolves: https://musescore.org/en/node/301436

The accessibility navigation commands
(Alt+Left/Right, also Ctrl+Alt+Shift+Left/Right)
were not properly checking for mmrests,
resulting in selection of elements in the underlying measures
that were not valid in the current layout.
This adds the necessary checks.
Mostly just a matter of adding "MM" to various function calls.
In a couple of places, the appropriate function did not exist,
so I added it.
Also corrected errors in Ctrl+Alt+Shift+Left/Right
that occurs when going past the end of a staff,
the code to wrap around to the next staff this case well.
In part this is because the implementation of barlines changed
since the code was written.
Barlines are per-staff now even when spanned,
so the use and management of prevTrack is no longer appropriate._

Fix version
3.5.0