Courtesy time signature not removed when subsequent measures are deleted

• Apr 20, 2019 - 10:51
Reported version
3.1
Priority
P1 - High
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
fixed
Regression
No
Workaround
Yes
Project

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.1.0.6567, revision: 3c54040

See attached file. There is a courtesy Time Sig. at the end of system 1.

  1. Delete the Time Sig. at the start of system 2.
    Result: As expected. The courtesy Time Sig. is deleted as well.
  2. UNDO, select from the measure at the start of system 2 to the end of score, and press Ctrl + Delete.
    Expected result: Measures are deleted leaving NO courtesy time sig.
    Actual result: The courtesy Time Sig. remains at the end of system 1. A workaround is to close the score and reopen it; or append a measure to the score, then delete it.

See also, #102676: Deleting key signature doesn't remove courtesy one at end of single-measure system (in Page View)?

Attachment Size
courtesy_time_sig_not_deleted.mscz 5.33 KB

Comments

Priority P1 - High

For the record, the bug is also present in 3.0.5, and 2.3.2 as well. Also, the delete/undo steps aren't needed. Just load the score and delete from start of second system to end. Easily reproducible from scratch as well - default score, add time sig to start of second system, delete from there to end.

Same issue with keysigs, in master, FWIW, but in this case, it's not present in 2.3.2.

Status PR created fixed

Fixed in branch master, commit 2aafb6fd30

_fix #287998 and #102676

Resolves: https://musescore.org/en/node/287998
Resolves: https://musescore.org/en/node/102676

When a measure contains a line or page break and the next measure contains a key/time
signature or clef change, a courtesy element is drawn at the end of the measure.
However, if all measures after the line or page break are deleted, these courtesy
elements are not removed because Measure::addSystemTrailer(Measure) is never called
in Score::collectSystem(LayoutContext&) since there is no next measure. As a result
these courtesy elements are not disabled by Measure::addSystemTrailer(Measure
).
The solution is to call Measure::addSystemTrailer(Measure) even when nm equals 0 and
Measure::addSystemTrailer(Measure
) will disable all courtesy elements in case nm equals 0._

Fixed in branch master, commit a564a28b31

_Merge pull request #5662 from njvdberg/issue-287998-courtesy-ts-on-measure-delete

fix #287998 and #102676 : Courtesy time signature not removed when subsequent measures are deleted_

Fix version
3.5.0