Skip to content

Commit

Permalink
fix #121561: Score corruption when creating tremolos in Score+Parts
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Mar 1, 2017
1 parent b21414f commit 5908ba7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,14 @@ Chord::Chord(const Chord& c, bool link)
if (link)
score()->undo(new Link(const_cast<Arpeggio*>(c._arpeggio), a));
}
if (c._tremolo && !c._tremolo->twoNotes()) {
if (c._tremolo) {
Tremolo* t = new Tremolo(*(c._tremolo));
add(t);
if (link)
if (link) {
score()->undo(new Link(const_cast<Tremolo*>(c._tremolo), t));
if (c._tremolo->twoNotes())
t->setChords(0, 0);
}
}

for (Element* e : c.el()) {
Expand Down Expand Up @@ -446,7 +449,8 @@ void Chord::add(Element* e)
if (tr->chord2())
tr->chord2()->setDurationType(d);
}
tr->chord2()->setTremolo(tr);
if (tr->chord2())
tr->chord2()->setTremolo(tr);
}
_tremolo = tr;
}
Expand Down

0 comments on commit 5908ba7

Please sign in to comment.