Skip to content

Commit

Permalink
Fix #309419: instrument data not properly saved in linked staves
Browse files Browse the repository at this point in the history
  • Loading branch information
elerouxx committed Aug 25, 2020
1 parent f469566 commit 72dd9fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mscore/editstaff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,10 @@ void EditStaff::apply()
score->undo(new ChangePart(part, new Instrument(*part->instrument()), newPartName));
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 72dd9fb

Please sign in to comment.