Skip to content

Commit

Permalink
Merge pull request #4555 from jthistle/281350-feedback-barline-start-…
Browse files Browse the repository at this point in the history
…repeat

fix #281350: start repeat applied to barline changes wrong barline
  • Loading branch information
anatoly-os committed Jan 13, 2019
2 parents b0a0c85 + 99c033d commit 5f77473
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions libmscore/barline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ static void undoChangeBarLineType(BarLine* bl, BarLineType barType)
{
Measure* m = bl->measure();

if (barType == BarLineType::START_REPEAT) {
m->undoChangeProperty(Pid::REPEAT_END, false);
m = m->nextMeasure();
if (!m)
return;
}
else if (bl->barLineType() == BarLineType::START_REPEAT) {
m->undoChangeProperty(Pid::REPEAT_START, false);
m = m->prevMeasure();
if (!m)
return;
}

switch (barType) {
case BarLineType::END:
case BarLineType::NORMAL:
Expand Down Expand Up @@ -77,8 +90,6 @@ static void undoChangeBarLineType(BarLine* bl, BarLineType barType)
}
}
}
else if (segmentType == SegmentType::StartRepeatBarLine)
m->undoChangeProperty(Pid::REPEAT_START, false);
}
break;
case BarLineType::START_REPEAT:
Expand Down
2 changes: 2 additions & 0 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,8 @@ Element* Measure::drop(EditData& data)
if (cbl)
cbl->drop(data);
}
else if (bl->barLineType() == BarLineType::START_REPEAT)
undoChangeProperty(Pid::REPEAT_START, true);
else {
// drop to first end barline
seg = findSegmentR(SegmentType::EndBarLine, ticks());
Expand Down

0 comments on commit 5f77473

Please sign in to comment.