Skip to content

Commit

Permalink
fix #186706: export 7sus chord to MusicXML fails reimport
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed Apr 10, 2017
1 parent 33f6280 commit 5cb1bec
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions mscore/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5539,7 +5539,7 @@ void ExportMusicXml::harmony(Harmony const* const h, FretDiagram const* const fd
QStringList l = h->xmlDegrees();
if (!l.isEmpty()) {
for (QString tag : l) {
QString degreeText;
bool emptyDegreeText;
if (h->xmlKind().startsWith("suspended")
&& tag.startsWith("add") && tag[3].isDigit()
&& !kindText.isEmpty() && kindText[0].isDigit()) {
Expand All @@ -5550,13 +5550,10 @@ void ExportMusicXml::harmony(Harmony const* const h, FretDiagram const* const fd
for (int i = 0; i < kindText.length() && kindText[i].isDigit(); ++i)
kindTextExtension[i] = kindText[i];
int kindExtension = kindTextExtension.toInt();
if (tagDegree <= kindExtension && (tagDegree & 1) && (kindExtension & 1))
degreeText = "\"\"";
emptyDegreeText = tagDegree <= kindExtension && (tagDegree & 1) && (kindExtension & 1);
}
if (degreeText.isEmpty())
xml.stag("degree");
else
xml.stag("degree text=" + degreeText);

xml.stag("degree");
int alter = 0;
int idx = 3;
if (tag[idx] == '#') {
Expand All @@ -5567,10 +5564,16 @@ void ExportMusicXml::harmony(Harmony const* const h, FretDiagram const* const fd
alter = -1;
++idx;
}
xml.tag("degree-value", tag.mid(idx));
if (emptyDegreeText)
xml.tag("degree-value text=\"\"", tag.mid(idx));
else
xml.tag("degree-value", tag.mid(idx));
xml.tag("degree-alter", alter); // finale insists on this even if 0
if (tag.startsWith("add"))
xml.tag("degree-type", "add");
if (emptyDegreeText)
xml.tag("degree-type text=\"\"", "add");
else
xml.tag("degree-type", "add");
else if (tag.startsWith("sub"))
xml.tag("degree-type", "subtract");
else if (tag.startsWith("alt"))
Expand Down

0 comments on commit 5cb1bec

Please sign in to comment.