Undo of virtually any note operation destroys layout

• May 21, 2014 - 17:04
Type
Functional
Severity
S2 - Critical
Status
closed
Project
Tags

Windows 7, GIT commit: b00e0e5

1) create score
2) add a note
3) undo

Result: all measures become way too short, fitting way too many measures per system, clef for next systems moves onto this system, etc.

undo-mess.png

Seems to be pretty much any operation on a note, any score. If there are no line breaks holding things together, Undo destroys the layout.

Attachment Size
undo-mess.png 4.22 KB

Comments

This is just a visual problem. If you switch to continuous view mode, then back to normal view, all gets back to correct display.

Should be easy to fix.

No, can't be there, because bool Score::layoutSystem isn't even called after we pressed undo. But Scrore::layoutSystem is called after we pressed Ctrl+A. So the problem is that Score::layoutSystem should be called after the undo.

If we comment out the lines 1922 and 1923 of layout.cpp, the problem disappear.


if (undoRedo()) // no change possible in this state
return layoutSystem1(minWidth, isFirstSystem, longName);

layoutSystem1 is a function very similar to layoutSystem
So it seems like layoutSystem1 contains a problem that isn't present in layoutSystem.

I think we should have only one function for the layout instead of two similar ones. Maybe adding an "if" condition in layoutSystem if something related to undoRedo() shouldn't be done.