Skip to content

Commit

Permalink
fix #22559: Measure numbers, if set to all staves cannot later be unset
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Sep 6, 2013
1 parent 5232a0b commit 62803b8
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,28 +607,24 @@ void Measure::layout2()
QString s;
if (smn)
s = QString("%1").arg(_no + 1);
int sn = 0;
int nn = 1;
if (score()->styleB(ST_measureNumberAllStaffs))
nn = n;
else {
if (!score()->styleB(ST_measureNumberAllStaffs)) {
//find first non invisible staff
for (int staffIdx = 0; staffIdx < n; ++staffIdx) {
MStaff* ms = staves.at(staffIdx);
SysStaff* s = system()->staff(staffIdx);
Staff* staff = score()->staff(staffIdx);
if (ms->visible() && staff->show() && s->show()) {
sn = staffIdx;
nn = staffIdx + 1;
nn = staffIdx;
break;
}
}
}
for (int staffIdx = sn; staffIdx < nn; ++staffIdx) {
for (int staffIdx = 0; staffIdx < n; ++staffIdx) {
MStaff* ms = staves.at(staffIdx);
Text* t = ms->noText();
if (smn) {
if (t == 0) {
if (t == 0 && (staffIdx == nn || score()->styleB(ST_measureNumberAllStaffs))) {
t = new Text(score());
t->setFlag(ELEMENT_ON_STAFF, true);
t->setTrack(staffIdx * VOICES);
Expand All @@ -637,9 +633,11 @@ void Measure::layout2()
t->setParent(this);
score()->undoAddElement(t);
}
t->setText(s);
t->layout();
smn = score()->styleB(ST_measureNumberAllStaffs);
if(t) {
t->setText(s);
t->layout();
smn = score()->styleB(ST_measureNumberAllStaffs);
}
}
else {
if (t)
Expand Down

0 comments on commit 62803b8

Please sign in to comment.