Skip to content

Commit

Permalink
fix #93031 - invalid MusicXML for stafftext containing only formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lvinken committed Jan 24, 2016
1 parent d42c71e commit f210f93
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mscore/exportxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3096,7 +3096,7 @@ static void beatUnit(Xml& xml, const TDuration dur)

static void wordsMetrome(Xml& xml, Score* s, Text const* const text)
{
//qDebug("wordsMetrome('%s')", qPrintable(text->text()));
//qDebug("wordsMetrome('%s')", qPrintable(text->xmlText()));
const QList<TextFragment> list = text->fragmentList();
QList<TextFragment> wordsLeft; // words left of metronome
bool hasParen; // parenthesis
Expand Down Expand Up @@ -3164,7 +3164,7 @@ static void wordsMetrome(Xml& xml, Score* s, Text const* const text)
void ExportMusicXml::tempoText(TempoText const* const text, int staff)
{
/*
qDebug("ExportMusicXml::tempoText(TempoText='%s')", qPrintable(text->text()));
qDebug("ExportMusicXml::tempoText(TempoText='%s')", qPrintable(text->xmlText()));
*/
attr.doAttr(xml, false);
xml.stag(QString("direction placement=\"%1\"").arg((text->parent()->y()-text->y() < 0.0) ? "below" : "above"));
Expand All @@ -3187,11 +3187,13 @@ void ExportMusicXml::tempoText(TempoText const* const text, int staff)
void ExportMusicXml::words(Text const* const text, int staff)
{
/*
qDebug("ExportMusicXml::words userOff.x=%f userOff.y=%f text='%s'",
text->userOff().x(), text->userOff().y(), qPrintable(text->text()));
qDebug("ExportMusicXml::words userOff.x=%f userOff.y=%f xmlText='%s' plainText='%s'",
text->userOff().x(), text->userOff().y(),
qPrintable(text->xmlText()),
qPrintable(text->plainText()));
*/

if (text->xmlText() == "") {
if (text->plainText() == "") {
// sometimes empty Texts are present, exporting would result
// in invalid MusicXML (as an empty direction-type would be created)
return;
Expand All @@ -3208,7 +3210,7 @@ void ExportMusicXml::words(Text const* const text, int staff)

void ExportMusicXml::rehearsal(RehearsalMark const* const rmk, int staff)
{
if (rmk->xmlText() == "") {
if (rmk->plainText() == "") {
// sometimes empty Texts are present, exporting would result
// in invalid MusicXML (as an empty direction-type would be created)
return;
Expand Down

0 comments on commit f210f93

Please sign in to comment.