make score->save() undo-safe
This commit is contained in:
parent
bd8fd8967e
commit
8b8be3efa1
3 changed files with 21 additions and 8 deletions
|
@ -91,21 +91,24 @@ void Score::write(Xml& xml, bool selectionOnly)
|
|||
// then some layout information is missing:
|
||||
// relayout with all parts set visible
|
||||
|
||||
QList<Part*> hiddenParts;
|
||||
bool unhide = false;
|
||||
QList<bool> partsVisible;
|
||||
if (styleB(StyleIdx::createMultiMeasureRests)) {
|
||||
for (Part* part : _parts) {
|
||||
partsVisible.append(part->show());
|
||||
if (!part->show()) {
|
||||
unhide = true;
|
||||
part->setShow(true);
|
||||
if (!unhide) {
|
||||
startCmd();
|
||||
unhide = true;
|
||||
}
|
||||
undo(new ChangePartProperty(part, 0, true));
|
||||
hiddenParts.append(part);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (unhide) {
|
||||
doLayout();
|
||||
for (int i = 0; i < partsVisible.size(); ++i)
|
||||
_parts[i]->setShow(partsVisible[i]);
|
||||
for (Part* p : hiddenParts)
|
||||
p->setShow(false);
|
||||
}
|
||||
|
||||
xml.stag("Score");
|
||||
|
@ -227,8 +230,11 @@ void Score::write(Xml& xml, bool selectionOnly)
|
|||
xml.tag("name", name());
|
||||
xml.etag();
|
||||
|
||||
if (unhide)
|
||||
doLayout();
|
||||
if (unhide) {
|
||||
endCmd();
|
||||
undo()->undo();
|
||||
endUndoRedo();
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
5
mtest/libmscore/selectionfilter/updateReference
Executable file
5
mtest/libmscore/selectionfilter/updateReference
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
cp ../../../build.debug/mtest/libmscore/selectionfilter/selectionfilter8-base.xml selectionfilter8-base-ref.xml
|
||||
cp ../../../build.debug/mtest/libmscore/selectionfilter/selectionfilter9-base.xml selectionfilter9-base-ref.xml
|
||||
|
2
thirdparty/xmlstream/.gitignore
vendored
Normal file
2
thirdparty/xmlstream/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
out
|
||||
|
Loading…
Reference in a new issue