Skip to content

Commit

Permalink
fix #32331: lower case minor chord issues on save/reload
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Sep 8, 2014
1 parent b7c2b5e commit 3bb1a14
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
23 changes: 17 additions & 6 deletions libmscore/harmony.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,13 @@ void Harmony::write(Xml& xml) const
xml.tag("root", rRootTpc);
if (_id > 0)
xml.tag("extension", _id);
if (_textName != "")
xml.tag("name", _textName);
// parser uses leading "=" as a hidden specifier for minor
QString writeName = _textName;
if (_parsedForm && _parsedForm->name().startsWith("="))
writeName = "=" + writeName;
if (writeName != "")
xml.tag("name", writeName);

if (rBaseTpc != Tpc::TPC_INVALID)
xml.tag("base", rBaseTpc);
foreach(const HDegree& hd, _degreeList) {
Expand Down Expand Up @@ -315,12 +320,18 @@ void Harmony::read(XmlReader& e)
// or constructed in the Chord Symbol Properties dialog.

if (_rootTpc != Tpc::TPC_INVALID) {
if (_id > 0)
if (_id > 0) {
// positive id will happen only for scores that were created with explicit chord lists
// lookup id in chord list and generate new description if necessary
getDescription();
else if (_textName != "")
// no id - look up name, in case it is in chord list with no id
}
else
{
// default case: look up by name
// description will be found for any chord already read in this score
// and we will generate a new one if necessary
getDescription(_textName);
}
}
else if (_textName == "") {
// unrecognized chords prior to 2.0 were stored as text with markup
Expand Down Expand Up @@ -838,7 +849,7 @@ const ChordDescription* Harmony::getDescription()

const ChordDescription* Harmony::getDescription(const QString& name, const ParsedChord* pc)
{
const ChordDescription* cd = descr(name,pc);
const ChordDescription* cd = descr(name, pc);
if (cd)
_id = cd->id;
else {
Expand Down
2 changes: 1 addition & 1 deletion vtest/gen
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else
chord-layout-11 chord-layout-12 chord-layout-13 chord-layout-14\
accidental-1 accidental-2 accidental-3 accidental-4 accidental-5\
accidental-6 accidental-7 accidental-8 accidental-9\
tie-1 tie-2 grace-1 grace-2 grace-3 harmony-1 harmony-2 harmony-3 beams-1 beams-2\
tie-1 tie-2 grace-1 grace-2 grace-3 harmony-1 harmony-2 harmony-3 harmony-4 beams-1 beams-2\
user-offset-1 user-offset-2 chord-space-1 tablature-1 image-1"
fi

Expand Down
2 changes: 1 addition & 1 deletion vtest/gen.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set SRC=mmrest-1,bravura-mmrest,mmrest-2,mmrest-4,mmrest-5,mmrest-6,mmrest-7,mmr
chord-layout-11,chord-layout-12,chord-layout-13,chord-layout-13, ^
accidental-1,accidental-2,accidental-3,accidental-4,accidental-5, ^
accidental-6,accidental-7,accidental-8,accidental-9, ^
tie-1,tie-2,grace-1,grace-2,grace-3,harmony-1,harmony-2,harmony-3,beams-1,beams-2, ^
tie-1,tie-2,grace-1,grace-2,grace-3,harmony-1,harmony-2,harmony-3,harmony-4,beams-1,beams-2, ^
user-offset-1,user-offset-2,chord-space-1,tablature-1,image-1

set MSCORE=..\win32install\bin\mscore.exe
Expand Down
Binary file added vtest/harmony-4-ref.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vtest/harmony-4.mscz
Binary file not shown.

0 comments on commit 3bb1a14

Please sign in to comment.