Skip to content
Permalink
Browse files

Merge pull request #2364 from Jojo-Schmitz/xml-fret-diag-crash

fix #95866: crash on export of fretboard diagram that doesn't have any fret marks
  • Loading branch information...
lasconic committed Jan 29, 2016
2 parents a2caf8c + f5e2a9f commit 2b40a5a0d8a17492106e0aab7bb883045ff4777c
Showing with 8 additions and 4 deletions.
  1. +8 −4 libmscore/fret.cpp
@@ -589,21 +589,25 @@ void FretDiagram::readMusicXML(XmlReader& e)
void FretDiagram::writeMusicXML(Xml& xml) const
{
qDebug("FretDiagram::writeMusicXML() this %p harmony %p", this, _harmony);
int _strings = strings();
xml.stag("frame");
xml.tag("frame-strings", strings());
xml.tag("frame-strings", _strings);
xml.tag("frame-frets", frets());
QString strDots = "'";
QString strMarker = "'";
QString strFingering = "'";
for (int i = 0; i < strings(); ++i) {
for (int i = 0; i < _strings; ++i) {
// TODO print frame note
if (_dots) strDots += QString("%1'").arg(static_cast<int>(_dots[i]));
if (_marker) strMarker += QString("%1'").arg(static_cast<int>(_marker[i]));
if (_fingering) strFingering += QString("%1'").arg(static_cast<int>(_fingering[i]));
if (_marker[i] != 88) {
xml.stag("frame-note");
xml.tag("string", strings() - i);
xml.tag("fret", _dots[i]);
xml.tag("string", _strings - i);
if (_dots)
xml.tag("fret", _dots[i]);
else
xml.tag("fret", "0");
xml.etag();
}
}

0 comments on commit 2b40a5a

Please sign in to comment.
You can’t perform that action at this time.