[trunk] When reducing bar line span, other bar lines are not updated
Setup: rev. 4809; Ubuntu 11.04, Qt SDK 1.1.3 (Qt lib 4.7.4)
1) Open or create a score with more than 1 stave; for instance a pianoforte score
2) Select a bar line and enter edit mode
3) Drag the bar line to span fewer staves (1 in the example above)
4) Exit edit mode
Result: neither after 3) or after 4) the other bar lines are update to span fewer staves, only the bar being edited is.
1) This happens both for 'original' multiple-stave spans (i.e. created with the instrument, if it uses a grand stave) and for multiple-stave spans created by extending an existing bar line span.
2) When bar line span is increased, all the other bar lines are update to the greater span after step 3) above.
3) When another following action triggers a complete re-laying out (for instance, opening the property dlg of a note, a rest or a measure), 'wrong' bar lines are updated.
The issue is probably due to the fact that, in function
BarLine::endEditDrag() (file barline.cpp, line 515 and seg.), the case when span increases is deal with in lines 515-527, while the case when span decreases seems to be ignored; something like the following code should be added after line 527:
int diff = _span - newSpan;
staffIdx1 += newSpan;
staffIdx2 = staffIdx1 + diff;
Measure* meas = score()->firstMeasure();
meas->[create bar lines for no-longer-spanned staves];
meas = [next measure];
1) Should not the whole
if (newSpan != _span) block actually belong to
2) Should not the
score()->undoChangeBarLineSpan(staff(), _span) statement in line 529 actually be in
void BarLine::endEdit() rather than in