Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ Score* Score::clone()
XmlWriter xml(this, &buffer);
xml.header();

// TODO: this code to set MSC_VERSION explicitly causes the preview score in page settings dialog
// to always use current style defaults rather than those of the source score
// this clearly wrong for the page settings dialog and causes https://musescore.org/en/node/317272
// it's possible this code should be replaced by code that sets version based on the source score
// but it's also possible other code relies on the current behavior
// it's also possible MasterScore::clone() should contain the same change
// but for now, we are simply fixing up the style in PageSettings::setScore()
xml.stag("museScore version=\"" MSC_VERSION "\"");
write(xml, false);
xml.etag();
Expand Down
8 changes: 8 additions & 0 deletions mscore/pagesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ void PageSettings::setScore(Score* s)
cs = s;
delete clonedScore;
clonedScore = s->clone();
// HACK: clone doesn't actually copy style completely for older scores;
// instead it replaces any style settings that were at the older defaults with the current defaults
// this is not desired here, but might be in other places that Score::clone() is used
// so instead we simply re-copy the style here
int defaultsVersion = s->style().defaultStyleVersion();
clonedScore->style().setDefaultStyleVersion(defaultsVersion);
clonedScore->style() = s->style();

clonedScore->setLayoutMode(LayoutMode::PAGE);

clonedScore->doLayout();
Expand Down