Skip to content

Commit

Permalink
Don't clone excluded elements to new parts
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-spa committed Aug 18, 2023
1 parent 1468b09 commit 74da07b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/engraving/libmscore/excerpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ static MeasureBase* cloneMeasure(MeasureBase* mb, Score* score, const Score* osc
for (Segment* oseg = m->first(); oseg; oseg = oseg->next()) {
Segment* ns = nullptr; //create segment later, on demand
for (EngravingItem* e : oseg->annotations()) {
if (e->generated()) {
if (e->generated() || e->excludeFromOtherParts()) {
continue;
}
if ((e->track() == srcTrack && strack != mu::nidx && !e->systemFlag())
Expand Down Expand Up @@ -844,7 +844,7 @@ static MeasureBase* cloneMeasure(MeasureBase* mb, Score* score, const Score* osc
}
}

if (oe && !oe->generated()) {
if (oe && !oe->generated() && !oe->excludeFromOtherParts()) {
EngravingItem* ne;
ne = oe->linkedClone();
ne->setTrack(track);
Expand Down Expand Up @@ -1061,6 +1061,10 @@ void Excerpt::cloneStaves(Score* sourceScore, Score* dstScore, const std::vector

for (auto i : sourceScore->spanner()) {
Spanner* s = i.second;
if (s->excludeFromOtherParts()) {
continue;
}

track_idx_t dstTrack = mu::nidx;
track_idx_t dstTrack2 = mu::nidx;

Expand Down Expand Up @@ -1432,7 +1436,7 @@ void Excerpt::cloneStaff2(Staff* srcStaff, Staff* dstStaff, const Fraction& star
}

for (EngravingItem* e : oseg->annotations()) {
if (e->generated()) {
if (e->generated() || e->excludeFromOtherParts()) {
continue;
}
bool systemObject = e->systemFlag() && e->track() == 0;
Expand All @@ -1450,7 +1454,7 @@ void Excerpt::cloneStaff2(Staff* srcStaff, Staff* dstStaff, const Fraction& star
}

EngravingItem* oe = oseg->element(srcTrack);
if (oe == 0 || oe->generated()) {
if (oe == 0 || oe->generated() || oe->excludeFromOtherParts()) {
continue;
}

Expand Down Expand Up @@ -1513,7 +1517,7 @@ void Excerpt::cloneStaff2(Staff* srcStaff, Staff* dstStaff, const Fraction& star

for (auto i : oscore->spanner()) {
Spanner* s = i.second;
if (!(s->tick() >= startTick && s->tick2() < endTick)) {
if (!(s->tick() >= startTick && s->tick2() < endTick) || s->excludeFromOtherParts()) {
continue;
}

Expand Down

0 comments on commit 74da07b

Please sign in to comment.