fix #68956: reducing span leaves one-line staff with no barlines

This commit is contained in:
lasconic 2015-07-14 17:02:17 +02:00
parent 20bac97149
commit 94d60e7f86

View file

@ -844,8 +844,13 @@ void BarLine::endEdit()
int idx1 = staffIdx() + _span;
int idx2 = staffIdx() + staff()->barLineSpan();
// set standard span for each no-longer-spanned staff
for (int idx = idx1; idx < idx2; ++idx)
score()->undoChangeBarLineSpan(score()->staff(idx), 1, 0, (score()->staff(idx)->lines()-1)*2);
for (int idx = idx1; idx < idx2; ++idx) {
Staff* staff = score()->staff(idx);
int lines = staff->lines();
int spanFrom = lines == 1 ? BARLINE_SPAN_1LINESTAFF_FROM : 0;
int spanTo = lines == 1 ? BARLINE_SPAN_1LINESTAFF_TO : (lines - 1) * 2;
score()->undoChangeBarLineSpan(staff, 1, spanFrom, spanTo);
}
}
}