Skip to content

Commit

Permalink
Merge pull request #602 from mgavioli/basestyle_and_defaultstyle
Browse files Browse the repository at this point in the history
Default style, base style, saving and reading score file styles.
  • Loading branch information
mgavioli committed Dec 28, 2013
2 parents e3e61d5 + 2d76253 commit 74ef206
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions libmscore/style.cpp
Expand Up @@ -1081,8 +1081,8 @@ bool StyleData::isDefault(StyleIdx idx) const

//---------------------------------------------------------
// save
// if optimize is true, save only if different to default
// style
// if optimize is true, save only data which are different
// from built-in style ( MScore::baseStyle() )
//---------------------------------------------------------

void StyleData::save(Xml& xml, bool optimize) const
Expand All @@ -1103,7 +1103,7 @@ void StyleData::save(Xml& xml, bool optimize) const
}
}
for (int i = 0; i < TEXT_STYLES; ++i) {
if (!optimize || _textStyles[i] != MScore::defaultStyle()->textStyle(i))
if (!optimize || _textStyles[i] != MScore::baseStyle()->textStyle(i))
_textStyles[i].write(xml);
}
for (int i = TEXT_STYLES; i < _textStyles.size(); ++i)
Expand All @@ -1114,7 +1114,7 @@ void StyleData::save(Xml& xml, bool optimize) const
xml.etag();
}
for (int i = 0; i < ARTICULATIONS; ++i) {
if (optimize && _articulationAnchor[i] == MScore::defaultStyle()->articulationAnchor(i))
if (optimize && _articulationAnchor[i] == MScore::baseStyle()->articulationAnchor(i))
continue;
const ArticulationInfo& ai = Articulation::articulationList[i];
xml.tag(ai.name + "Anchor", int(_articulationAnchor[i]));
Expand Down
2 changes: 1 addition & 1 deletion mscore/file.cpp
Expand Up @@ -308,7 +308,7 @@ Score* MuseScore::readScore(const QString& name)
if (name.isEmpty())
return 0;

Score* score = new Score(MScore::defaultStyle());
Score* score = new Score(MScore::baseStyle()); // start with built-in style
setMidiPrefOperations(name);
Score::FileError rv = Ms::readScore(score, name, false);
if (rv == Score::FILE_TOO_OLD || rv == Score::FILE_TOO_NEW) {
Expand Down

0 comments on commit 74ef206

Please sign in to comment.