Skip to content

Commit

Permalink
fix #63231: crash shortening a spanner
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella authored and lasconic committed Jun 26, 2015
1 parent 8d7ab2b commit ea43dd9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions libmscore/edit.cpp
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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.