From 492d7efab49cffe8fbd5853b9734fcc4ab4ce8cb Mon Sep 17 00:00:00 2001 From: Dmitri Ovodok Date: Thu, 14 Nov 2019 09:44:53 +0200 Subject: [PATCH] Merge pull request #5470 from mattmcclinch/296960-percent-sign fix #296960: Percent sign cannot be entered into text. --- libmscore/xmlwriter.cpp | 2 -- mscore/palette/palettetree.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libmscore/xmlwriter.cpp b/libmscore/xmlwriter.cpp index 76e3920dbef28..dc466eddc6516 100644 --- a/libmscore/xmlwriter.cpp +++ b/libmscore/xmlwriter.cpp @@ -334,8 +334,6 @@ QString XmlWriter::xmlString(ushort c) return QLatin1String("&"); case '\"': return QLatin1String("""); - case '%': - return QLatin1String("%"); default: // ignore invalid characters in xml 1.0 if ((c < 0x20 && c != 0x09 && c != 0x0A && c != 0x0D)) diff --git a/mscore/palette/palettetree.cpp b/mscore/palette/palettetree.cpp index 478873e9c103e..e76999c1bfb3a 100644 --- a/mscore/palette/palettetree.cpp +++ b/mscore/palette/palettetree.cpp @@ -212,11 +212,11 @@ void PaletteCell::write(XmlWriter& xml) const // using attributes for `custom` and `visible` // properties instead of nested tags for pre-3.3 // version compatibility - xml.stag(QString("Cell%1%2%3%4") - .arg(!name.isEmpty() ? QString(" name=\"%1\"").arg(XmlWriter::xmlString(name)) : "") - .arg(custom ? " custom=\"1\"" : "") - .arg(!visible ? " visible=\"0\"" : "") - .arg(untranslatedElement ? " trElement=\"1\"" : "") + xml.stag(QString("Cell") + + (!name.isEmpty() ? " name=\"" + XmlWriter::xmlString(name) + "\"" : "") + + (custom ? " custom=\"1\"" : "") + + (!visible ? " visible=\"0\"" : "") + + (untranslatedElement ? " trElement=\"1\"" : "") ); if (drawStaff)