Skip to content

Commit

Permalink
Manually merged #6491 to master
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoly-os committed Sep 1, 2020
1 parent 9ded76a commit 0c423f0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mscore/editstaff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,12 @@ void EditStaff::apply()
}
if (instrumentFieldChanged) {
Segment* s = score->tick2segment(_tickStart, true, SegmentType::ChordRest);
Element* e
= s ? s->findAnnotation(ElementType::INSTRUMENT_CHANGE, part->startTrack(),
part->endTrack()) : nullptr;
if (e) {
score->undo(new ChangeInstrument(toInstrumentChange(e), new Instrument(instrument)));
const std::vector<Element*> elist = s ? s->findAnnotations(ElementType::INSTRUMENT_CHANGE,
part->startTrack(), part->endTrack()) : elist;
if (elist.size()) {
for (Element* e : elist) { // Change instrument in all Instrument Changes (for linked staves)
score->undo(new ChangeInstrument(toInstrumentChange(e), new Instrument(instrument)));
}
} else {
score->undo(new ChangePart(part, new Instrument(instrument), newPartName));
}
Expand Down

0 comments on commit 0c423f0

Please sign in to comment.