Bad key change after undoing the enabling of multimeasure rests

• Jun 20, 2019 - 19:48
Reported version
3.1
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

Steps to reproduce:

  1. Default “Untitled” score.
  2. Add a key signature to measure 5.
  3. Press M.
  4. Undo.

The key has been changed back to C Major, but there is a key signature in measure 5.


Comments

Status active PR created

This is because when the key signature was added to the multimeasure rest, its generated flag was not set to true. So when the operation is undone, this line of code gets executed, which is not what is desired, since at this point we are only trying to undo the enabling of multimeasure rests. To fix this, we simply need to set the key signature’s generated flag to true before pushing the AddElement operation to the undo stack. See https://github.com/musescore/MuseScore/pull/5147.

Fix version
3.3.3