Fix repeat start barline couldn't be replaced

This commit is contained in:
bakajikara 2023-03-03 01:09:55 +09:00
parent 3ee6a91213
commit 17a2a84c55

View file

@ -81,6 +81,7 @@ static void undoChangeBarLineType(BarLine* bl, BarLineType barType, bool allStav
if (!m) {
return;
}
bl = const_cast<BarLine*>(m->endBarLine());
}
switch (barType) {
@ -138,6 +139,9 @@ static void undoChangeBarLineType(BarLine* bl, BarLineType barType, bool allStav
}
lmeasure->undoChangeProperty(Pid::REPEAT_END, false);
if (lmeasure->nextMeasure() && !lmeasure->nextMeasure()->isFirstInSystem()) {
lmeasure->nextMeasure()->undoChangeProperty(Pid::REPEAT_START, false);
}
Segment* lsegment = lmeasure->undoGetSegmentR(SegmentType::EndBarLine, lmeasure->ticks());
BarLine* lbl = toBarLine(lsegment->element(ltrack));
if (!lbl) {
@ -821,12 +825,6 @@ EngravingItem* BarLine::drop(EditData& data)
BarLine* bl = toBarLine(e);
BarLineType st = bl->barLineType();
// if no change in subtype or no change in span, do nothing
if (st == barLineType() && !bl->spanFrom() && !bl->spanTo()) {
delete e;
return 0;
}
// check if the new property can apply to this single bar line
BarLineType bt = BarLineType::START_REPEAT | BarLineType::END_REPEAT | BarLineType::END_START_REPEAT;
bool oldRepeat = barLineType() & bt;