Skip to content

Commit

Permalink
fix #48811 Redo Paste does not restore ties
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Feb 26, 2015
1 parent 74ac9b5 commit c47ec85
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,7 @@ void Note::remove(Element* e)
setTieFor(0);
if (tie->endNote())
tie->endNote()->setTieBack(0);
int n = tie->spannerSegments().size();
for (int i = 0; i < n; ++i) {
SpannerSegment* ss = tie->spannerSegments().at(i);
for (SpannerSegment* ss : tie->spannerSegments()) {
Q_ASSERT(ss->spanner() == tie);
if (ss->system())
ss->system()->remove(ss);
Expand Down Expand Up @@ -901,10 +899,15 @@ void Note::read(XmlReader& e)
else if (tag == "line")
_line = e.readInt();
else if (tag == "Tie") {
_tieFor = new Tie(score());
_tieFor->setTrack(track());
_tieFor->read(e);
_tieFor->setStartNote(this);
Tie* tie = new Tie(score());
tie->setParent(this);
tie->setTrack(track());
tie->read(e);
tie->setStartNote(this);
if (e.pasteMode())
score()->undo(new AddElement(tie));
else
_tieFor = tie;
}
else if (tag == "Fingering" || tag == "Text") { // Text is obsolete
Fingering* f = new Fingering(score());
Expand Down

0 comments on commit c47ec85

Please sign in to comment.