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 2, 2017
1 parent f28eaf2 commit af90627
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libmscore/chord.cpp
Expand Up @@ -259,11 +259,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 @@ -452,7 +455,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 af90627

Please sign in to comment.