Skip to content

Commit

Permalink
Merge pull request #4714 from mattmcclinch/284445-change-single-barline
Browse files Browse the repository at this point in the history
fix #284445: Ctrl key is ignored when trying to limit barline change to single staff
  • Loading branch information
anatoly-os committed Mar 4, 2019
2 parents 2f9967a + 8f4ba23 commit 91ca2b7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions libmscore/barline.cpp
Expand Up @@ -33,7 +33,7 @@ namespace Ms {
// undoChangeBarLineType
//---------------------------------------------------------

static void undoChangeBarLineType(BarLine* bl, BarLineType barType)
static void undoChangeBarLineType(BarLine* bl, BarLineType barType, bool allStaves)
{
Measure* m = bl->measure();

Expand Down Expand Up @@ -64,7 +64,8 @@ static void undoChangeBarLineType(BarLine* bl, BarLineType barType)
SegmentType segmentType = segment->segmentType();
if (segmentType == SegmentType::EndBarLine) {
m->undoChangeProperty(Pid::REPEAT_END, false);
for (Element* e : segment->elist()) {
const std::vector<Element*>& elist = allStaves ? segment->elist() : std::vector<Element*> { bl };
for (Element* e : elist) {
if (e) {
for (ScoreElement* ee : e->linkList()) {
ee->score()->undo(new ChangeProperty(ee, Pid::BARLINE_TYPE, QVariant::fromValue(barType), PropertyFlags::NOSTYLE));
Expand Down Expand Up @@ -633,10 +634,10 @@ Element* BarLine::drop(EditData& data)
}
// if drop refers to subtype, update this bar line subtype
else
undoChangeBarLineType(this, st);
undoChangeBarLineType(this, st, false);
}
else
undoChangeBarLineType(this, st);
undoChangeBarLineType(this, st, true);
delete e;
}
else if (e->isArticulation()) {
Expand Down Expand Up @@ -1220,7 +1221,7 @@ void BarLine::undoChangeProperty(Pid id, const QVariant& v, PropertyFlags ps)
bl = 0;
}
if (bl)
undoChangeBarLineType(const_cast<BarLine*>(bl), v.value<BarLineType>());
undoChangeBarLineType(const_cast<BarLine*>(bl), v.value<BarLineType>(), true);
}
else
ScoreElement::undoChangeProperty(id, v, ps);
Expand Down

0 comments on commit 91ca2b7

Please sign in to comment.