Skip to content
Permalink
Browse files

fix #63231: crash shortening a spanner

  • Loading branch information...
MarcSabatella authored and lasconic committed Jun 25, 2015
1 parent 8d7ab2b commit ea43dd95f795486916891e2e94e3cf77700120d2
Showing with 10 additions and 3 deletions.
  1. +10 −3 libmscore/edit.cpp
@@ -2779,7 +2779,8 @@ MeasureBase* Score::insertMeasure(Element::Type type, MeasureBase* measure, bool

void Score::checkSpanner(int startTick, int endTick)
{
QList<Spanner*> sl;
QList<Spanner*> sl; // spanners to remove
QList<Spanner*> sl2; // spanners to shorten
auto spanners = _spanner.findOverlapping(startTick, endTick);
// printf("checkSpanner %d %d\n", startTick, endTick);
// for (auto i = spanners.begin(); i < spanners.end(); i++) {
@@ -2816,13 +2817,19 @@ void Score::checkSpanner(int startTick, int endTick)
}
else {
if (s->tick2() > lastTick)
s->undoChangeProperty(P_ID::SPANNER_TICKS, lastTick - s->tick());
sl2.append(s); //s->undoChangeProperty(P_ID::SPANNER_TICKS, lastTick - s->tick());
else
s->computeEndElement();
}
s->computeEndElement();
}
}
for (auto s : sl) // actually remove scheduled spanners
undo(new RemoveElement(s));
for (auto s : sl2) { // shorten spanners that extended past end of score
undo(new ChangeProperty(s, P_ID::SPANNER_TICKS, lastTick - s->tick()));
s->computeEndElement();
}
}

}

0 comments on commit ea43dd9

Please sign in to comment.
You can’t perform that action at this time.