fix #179736 BarLine not correctly linked

This commit is contained in:
Felix Brauchle 2018-11-15 21:32:21 -06:00
parent 09f90b22f5
commit ecd9e761e8
2 changed files with 9 additions and 3 deletions

View file

@ -43,13 +43,19 @@ static void undoChangeBarLineType(BarLine* bl, BarLineType barType)
case BarLineType::BROKEN:
case BarLineType::DOTTED: {
Segment* segment = bl->segment();
for (ScoreElement* el : bl->linkList()) {
if (el->score()->isMaster() && el->isBarLine())
segment = toBarLine(el)->segment();
}
SegmentType segmentType = segment->segmentType();
if (segmentType == SegmentType::EndBarLine) {
m->undoChangeProperty(Pid::REPEAT_END, false);
for (Element* e : segment->elist()) {
if (e) {
e->score()->undo(new ChangeProperty(e, Pid::BARLINE_TYPE, QVariant::fromValue(barType), PropertyFlags::NOSTYLE));
e->score()->undo(new ChangeProperty(e, Pid::GENERATED, false, PropertyFlags::NOSTYLE));
for (ScoreElement* ee : e->linkList()) {
ee->score()->undo(new ChangeProperty(ee, Pid::BARLINE_TYPE, QVariant::fromValue(barType), PropertyFlags::NOSTYLE));
ee->score()->undo(new ChangeProperty(ee, Pid::GENERATED, false, PropertyFlags::NOSTYLE));
}
}
}
}

View file

@ -1677,7 +1677,7 @@ void Score::deleteItem(Element* el)
else if (bl->barLineType() == BarLineType::END_REPEAT)
m->undoChangeProperty(Pid::REPEAT_END, false);
else
undoRemoveElement(el);
bl->undoChangeProperty(Pid::BARLINE_TYPE, QVariant::fromValue(BarLineType::NORMAL));
}
}
break;