Toggling multi measure rest on and off does not save subsequent barline styles changed exclusively from inspector
Reproduction:
1) Open a new Score
2) Toggle multi measure rest on and then off
3) Change the style of any barline(s) using inspector only
4) Save the mscz file
Result: After closing the save window, the styled barlines in the current score(just saved) get replaced by normal barlines. On loading the saved file too, the barlines don't have their styling any more
Note: This bug doesn't occur when I modify the style of atleast one barline from the Barlines Palette. Setting styles of barlines from exclusively the inspector causes this bug.
Comments
Barlines at the end of multimeasure rests have come up in many issues so far. I stumbled upon this bug when looking at https://musescore.org/en/node/102691.
If this can be confirmed, I'll investigate further
I can confirm. I also see other fun effects, like if I set a custom barline style to any barline using Inspector, then toggle mmrests on then off again, the barline gets reset to normal - either right away, or as soon as I click on it.
When multimeasure is toggled ON, multimeasure rests are assigned to measures in "Measure::Measure* _mmRest;"
But the same _mmrest is never set to null (or 0) when a multimeasure is toggled OFF.
*Is this a conscious design choice?*
I think, NOT setting the _mmrest to null when multimeasure rests are toggled OFF is causing buggy behaviour in many places in the code. For this issue in specific, https://github.com/musescore/MuseScore/blob/master/libmscore/scorefile…, finds m->mmRest() to be valid even when mm rests are toggled OFF and hence sets the barline type to m->endBarLineType(), and not the custom type assigned by the user.
I kind of thnk it is deliberate, although I am not sure. I suspect the idea is to preserve any elements attached to those mmrest measures and any manual adjustments you have made to them, so that after toggling mmrests off and then back on, everythng is just how you left it. I imagine that clearing the mmrest ponters would defeat that.
PR submitted at https://github.com/musescore/MuseScore/pull/2518
Do I set it to: "patch (code needs review)" when I submit a PR? I've set this one to.
I can't reproduce anymore in master.
Automatically closed -- issue fixed for 2 weeks with no activity.