Skip to content

Commit

Permalink
when deleting "global key signature" in part, make sure all key signa…
Browse files Browse the repository at this point in the history
…tures in score will be deleted too
  • Loading branch information
sammik committed Aug 11, 2024
1 parent e6dd3ef commit 42f32f8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/engraving/dom/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3567,6 +3567,24 @@ void Score::cmdDeleteSelection()
for (EngravingObject* se : links) {
deletedElements.insert(se);
}

// when deleting "global key signature" in part,
// make sure all key signatures in score will be deleted too
// (part score doesn't need to contain all staves)
if (e->isKeySig() && !score()->isMaster() && toSegment(e->explicitParent())->empty()) {
for (EngravingObject* linkedSig : links) {
Score* score = linkedSig->score();
if (score->isMaster()) {
Segment* keySeg = toSegment(linkedSig->explicitParent());
for (staff_idx_t i = 0; i < score->nstaves(); ++i) {
track_idx_t track = i * VOICES;
if (EngravingItem* sig = keySeg->element(track)) {
score->deleteItem(sig);
}
}
}
}
}
}
}

Expand Down

0 comments on commit 42f32f8

Please sign in to comment.