Skip to content
Permalink
Browse files

Merge pull request #4714 from mattmcclinch/284445-change-single-barline

fix #284445: Ctrl key is ignored when trying to limit barline change to single staff
  • Loading branch information...
anatoly-os committed Mar 4, 2019
1 parent 23d3c53 commit 8a629fd5a7c43d96c7bb5f39dd3d0846222ed48e
Showing with 6 additions and 5 deletions.
  1. +6 −5 libmscore/barline.cpp
@@ -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();

@@ -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));
@@ -634,10 +635,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()) {
@@ -1221,7 +1222,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);

0 comments on commit 8a629fd

Please sign in to comment.
You can’t perform that action at this time.