Skip to content

Commit

Permalink
fix #149746 Undi actual duration change creates corruption
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Apr 23, 2018
1 parent 287f99d commit 10af232
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@
#include "stafflines.h"
#include "bracket.h"

// Q_LOGGING_CATEGORY(undoRedo, "undoRedo")

namespace Ms {

extern Measure* tick2measure(int tick);
Expand Down Expand Up @@ -1034,12 +1032,19 @@ void ChangeMeasureLen::flip(EditData*)
// move EndBarLine and TimeSigAnnounce
// to end of measure:
//
int endTick = measure->tick() + len.ticks();
for (Segment* segment = measure->first(); segment; segment = segment->next()) {
if (segment->segmentType() != SegmentType::EndBarLine
&& segment->segmentType() != SegmentType::TimeSigAnnounce)

Segment* s = measure->first();
std::list<Segment*> sl;
for (; s;) {
Segment* ns = s->next();
if (!s->isEndBarLineType() && !s->isTimeSigAnnounceType()) {
s = ns;
continue;
segment->setTick(endTick);
}
s->setRtick(len.ticks());
sl.push_back(s);
measure->remove(s);
s = ns;
}
measure->setLen(len);
measure->score()->fixTicks();
Expand Down
2 changes: 1 addition & 1 deletion mscore/debugger/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ void RestView::setElement(Element* e)

rb.sym->setValue(int(rest->sym()));
rb.dotline->setValue(rest->getDotline());
rb.mmWidth->setValue(rest->mmWidth());
rb.mmWidth->setValue((rest->measure() && rest->measure()->isMMRest()) ? rest->mmWidth() : 0.0);
rb.gap->setChecked(rest->isGap());
}

Expand Down

0 comments on commit 10af232

Please sign in to comment.