diff --git a/libmscore/text.cpp b/libmscore/text.cpp index 0c4905b03843..009763aa01ce 100644 --- a/libmscore/text.cpp +++ b/libmscore/text.cpp @@ -1383,7 +1383,6 @@ void Text::genText() } while (!xmlNesting.isEmpty()) xmlNesting.popToken(); - printf("gen text <%s>\n", qPrintable(_text)); } //--------------------------------------------------------- @@ -1907,9 +1906,9 @@ bool Text::readProperties(XmlReader& e) else if (tag == "data") // obsolete e.readElementText(); else if (tag == "html") - setText(Xml::xmlString(QTextDocumentFragment::fromHtml(e.readXml()).toPlainText())); + setPlainText(QTextDocumentFragment::fromHtml(e.readXml()).toPlainText()); else if (tag == "text") - setText(e.readXml()); + _text = e.readXml(); else if (tag == "html-data") { QString s = e.readXml(); if (score()->mscVersion() <= 114) { @@ -1929,7 +1928,7 @@ bool Text::readProperties(XmlReader& e) s.replace(QChar(0xe168), QString("%1%2").arg(QChar(0xd834)).arg(QChar(0xdd0c))); // varcoda s.replace(QChar(0xe169), QString("%1%2").arg(QChar(0xd834)).arg(QChar(0xdd0c))); // segno } - setText(Xml::xmlString(QTextDocumentFragment::fromHtml(s).toPlainText())); + setPlainText(QTextDocumentFragment::fromHtml(s).toPlainText()); } else if (tag == "subtype") // obsolete e.skipCurrentElement(); @@ -2176,6 +2175,14 @@ Element* Text::drop(const DropData& data) return 0; } +//--------------------------------------------------------- +// setPlainText +//--------------------------------------------------------- + +void Text::setPlainText(const QString& s) + { + _text = s.toHtmlEscaped(); + } } diff --git a/libmscore/text.h b/libmscore/text.h index 3fdf6eb1e1d2..38a0037f6b49 100644 --- a/libmscore/text.h +++ b/libmscore/text.h @@ -215,8 +215,9 @@ class Text : public Element { const TextStyle& textStyle() const { return _textStyle; } TextStyle& textStyle() { return _textStyle; } - void setText(const QString& s) { _text = s; } - QString text() const { return _text; } + void setPlainText(const QString& s); + void setText(const QString& s) { _text = s; } + QString text() const { return _text; } void insertText(const QString&); virtual void layout(); diff --git a/mscore/file.cpp b/mscore/file.cpp index fe12d233b34f..9e38ba397ade 100644 --- a/mscore/file.cpp +++ b/mscore/file.cpp @@ -693,27 +693,27 @@ void MuseScore::newFile() if (!title.isEmpty()) { Text* s = new Text(score); s->setTextStyleType(TEXT_STYLE_TITLE); - s->setText(title); + s->setPlainText(title); measure->add(s); score->setMetaTag("workTitle", title); } if (!subtitle.isEmpty()) { Text* s = new Text(score); s->setTextStyleType(TEXT_STYLE_SUBTITLE); - s->setText(subtitle); + s->setPlainText(subtitle); measure->add(s); } if (!composer.isEmpty()) { Text* s = new Text(score); s->setTextStyleType(TEXT_STYLE_COMPOSER); - s->setText(composer); + s->setPlainText(composer); measure->add(s); score->setMetaTag("composer", composer); } if (!poet.isEmpty()) { Text* s = new Text(score); s->setTextStyleType(TEXT_STYLE_POET); - s->setText(poet); + s->setPlainText(poet); measure->add(s); // the poet() functions returns data called lyricist in the dialog score->setMetaTag("lyricist", poet); @@ -722,11 +722,7 @@ void MuseScore::newFile() if (newWizard->createTempo()) { double tempo = newWizard->tempo(); TempoText* tt = new TempoText(score); - - int uc = 0x1d15f; - QChar h(QChar::highSurrogate(uc)); - QChar l(QChar::lowSurrogate(uc)); - tt->setText(QString("%1%2 = %3").arg(h).arg(l).arg(tempo)); + tt->setText(QString("#noteQuarterUp# = %1").arg(tempo)); tempo /= 60; // bpm -> bps tt->setTempo(tempo);