Skip to content

Commit

Permalink
Merge pull request #3180 from Jojo-Schmitz/warnings
Browse files Browse the repository at this point in the history
fix warnings introduced by dd97f24
  • Loading branch information
lasconic committed May 24, 2017
2 parents 186fc69 + 113de44 commit bddc8e4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libmscore/harmony.cpp
Expand Up @@ -359,7 +359,7 @@ void Harmony::read(XmlReader& e)
// but we no longer support user-applied formatting for chord symbols anyhow
// with any luck, the resulting text will be parseable now, so give it a shot
createLayout();
QString s = plainText(true);
QString s = plainText();
if (!s.isEmpty()) {
setHarmony(s);
return;
Expand Down Expand Up @@ -1009,7 +1009,7 @@ const ChordDescription* Harmony::generateDescription()
void Harmony::textChanged()
{
// Text::createLayout();
setHarmony(plainText(true));
setHarmony(plainText());
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion libmscore/lyrics.cpp
Expand Up @@ -284,7 +284,7 @@ void Lyrics::layout1()
bool hasNumber = false; // _verseNumber;
qreal centerAdjust = 0.0;
qreal leftAdjust = 0.0;
QString s = plainText(true);
QString s = plainText();

// find:
// 1) string of numbers and non-word characters at start of syllable
Expand Down
8 changes: 3 additions & 5 deletions libmscore/text.cpp
Expand Up @@ -2201,18 +2201,16 @@ void Text::setXmlText(const QString& s)
// return plain text with symbols
//---------------------------------------------------------

QString Text::plainText(bool noSym) const
QString Text::plainText() const
{
QString s;

if (layoutInvalid)
((Text*)(this))->createLayout(); // ugh!

for (const TextBlock& block : _layout) {
for (const TextFragment& f : block.fragments()) {
const CharFormat& format = f.format;
for (const TextFragment& f : block.fragments())
s += f.text;
}
if (block.eol())
s += QChar::LineFeed;
}
Expand Down Expand Up @@ -2437,7 +2435,7 @@ QString Text::accessibleInfo() const
rez = Element::accessibleInfo();
break;
}
QString s = plainText(true).simplified();
QString s = plainText().simplified();
if (s.length() > 20) {
s.truncate(20);
s += "...";
Expand Down
2 changes: 1 addition & 1 deletion libmscore/text.h
Expand Up @@ -276,7 +276,7 @@ class Text : public Element {
void setPlainText(const QString&);
void setXmlText(const QString&);
QString xmlText() const;
QString plainText(bool noSym = false) const;
QString plainText() const;

void insertText(EditData&, const QString&);

Expand Down
2 changes: 1 addition & 1 deletion mscore/file.cpp
Expand Up @@ -389,7 +389,7 @@ bool MuseScore::saveFile(MasterScore* score)
QString fn = score->masterScore()->fileInfo()->fileName();
Text* t = score->getText(SubStyle::TITLE);
if (t)
fn = t->plainText(true);
fn = t->plainText();
QString name = createDefaultFileName(fn);
QString f1 = tr("MuseScore File") + " (*.mscz)";
QString f2 = tr("Uncompressed MuseScore File") + " (*.mscx)";
Expand Down

0 comments on commit bddc8e4

Please sign in to comment.