Skip to content

Commit 002ca83

Browse files
mike-spaJojo-Schmitz
authored andcommitted
Fix GH#27228: Don't remove and re-add spanner on rewrite measures
Backport of musescore#27352
1 parent 739c4e8 commit 002ca83

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

libmscore/range.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
// the file LICENCE.GPL
1111
//=============================================================================
1212

13-
#include "range.h"
13+
#include "barline.h"
14+
#include "chord.h"
15+
#include "excerpt.h"
1416
#include "measure.h"
15-
#include "segment.h"
17+
#include "note.h"
18+
#include "range.h"
19+
#include "repeat.h"
1620
#include "rest.h"
17-
#include "chord.h"
1821
#include "score.h"
22+
#include "segment.h"
1923
#include "slur.h"
24+
#include "staff.h"
2025
#include "tie.h"
21-
#include "note.h"
26+
#include "tremolo.h"
2227
#include "tuplet.h"
23-
#include "barline.h"
2428
#include "utils.h"
25-
#include "staff.h"
26-
#include "excerpt.h"
27-
#include "repeat.h"
28-
#include "tremolo.h"
2929

3030
namespace Ms {
3131

@@ -276,6 +276,9 @@ void TrackList::read(const Segment* fs, const Segment* es)
276276
Element* e = s->element(_track);
277277
if (!e || e->generated()) {
278278
for (Element* ee : s->annotations()) {
279+
if (ee->systemFlag() && ee->track() != 0) // Only process the top system object
280+
continue;
281+
279282
if (ee->track() == _track)
280283
_range->annotations.push_back({ s->tick(), ee->clone() });
281284
}
@@ -665,6 +668,9 @@ void ScoreRange::read(Segment* first, Segment* last, bool readSpanner)
665668
Fraction etick = last->tick();
666669
for (auto i : first->score()->spanner()) {
667670
Spanner* s = i.second;
671+
if (s->systemFlag() && s->track() != 0) // Only process the top system object
672+
continue;
673+
668674
if (s->tick() >= stick && s->tick() < etick && s->track() >= startTrack && s->track() < endTrack) {
669675
Spanner* ns = toSpanner(s->clone());
670676
ns->setParent(0);

0 commit comments

Comments
 (0)