diff --git a/importexport/guitarpro/importgtp-gp6.cpp b/importexport/guitarpro/importgtp-gp6.cpp index fdcf2618a58d9..168cf3347a0cf 100644 --- a/importexport/guitarpro/importgtp-gp6.cpp +++ b/importexport/guitarpro/importgtp-gp6.cpp @@ -2411,7 +2411,7 @@ void GuitarPro6::readMasterBars(GPPartInfo* partInfo) Segment* s = measure->getSegment(SegmentType::ChordRest, measure->tick()); if (bars[measureCounter].section[0].length()) { RehearsalMark* t = new RehearsalMark(score); - t->setFrameType(FrameType::SQUARE); + t->setFrameType(FrameType::RECTANGLE); t->setPlainText(bars[measureCounter].section[0]); t->setTrack(0); s->add(t); diff --git a/importexport/guitarpro/importptb.cpp b/importexport/guitarpro/importptb.cpp index e043f5a4ca442..37d66a837bd53 100644 --- a/importexport/guitarpro/importptb.cpp +++ b/importexport/guitarpro/importptb.cpp @@ -825,7 +825,7 @@ void PowerTab::addToScore(ptSection& sec) if (!sec.partName.empty() && lastPart != sec.partMarker) { lastPart = sec.partMarker; RehearsalMark* t = new RehearsalMark(score); - t->setFrameType(FrameType::SQUARE); + t->setFrameType(FrameType::RECTANGLE); t->setPlainText(QString(sec.partMarker)); t->setTrack(0); auto seg = measure->getSegment(SegmentType::ChordRest, measure->tick()); @@ -1265,7 +1265,7 @@ Score::FileError PowerTab::read() // static const char* tune[] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }; int id = 0; - for (Part* part : score->parts()) { + for (Part*& part : score->parts()) { QMultiMap tracks; Score* pscore = new Score(score); diff --git a/importexport/musicxml/exportxml.cpp b/importexport/musicxml/exportxml.cpp index 87a1ae3342268..86a2ac69ef072 100644 --- a/importexport/musicxml/exportxml.cpp +++ b/importexport/musicxml/exportxml.cpp @@ -656,7 +656,7 @@ static QString frame2xml(const TextBase* el) switch (el->frameType()) { case FrameType::CIRCLE: return " enclosure=\"circle\""; - case FrameType::SQUARE: + case FrameType::RECTANGLE: return " enclosure=\"rectangle\""; default: return QString(); diff --git a/importexport/musicxml/importmxmlpass2.cpp b/importexport/musicxml/importmxmlpass2.cpp index 84c0aa09236c0..60d2cfd949637 100644 --- a/importexport/musicxml/importmxmlpass2.cpp +++ b/importexport/musicxml/importmxmlpass2.cpp @@ -3481,7 +3481,7 @@ void MusicXMLParserDirection::direction(const QString& partId, t->setFrameType(FrameType::NO_FRAME); } else if (_enclosure == "rectangle") { - t->setFrameType(FrameType::SQUARE); + t->setFrameType(FrameType::RECTANGLE); t->setFrameRound(0); } @@ -3569,7 +3569,7 @@ void MusicXMLParserDirection::direction(const QString& partId, else if (_enclosure == "none") dynamic->setFrameType(FrameType::NO_FRAME); else if (_enclosure == "rectangle") { - dynamic->setFrameType(FrameType::SQUARE); + dynamic->setFrameType(FrameType::RECTANGLE); dynamic->setFrameRound(0); } diff --git a/libmscore/read114.cpp b/libmscore/read114.cpp index 23c284354e2b0..54d8ee9ca8cfc 100644 --- a/libmscore/read114.cpp +++ b/libmscore/read114.cpp @@ -274,7 +274,7 @@ static bool readTextProperties(XmlReader& e, TextBase* t, Element*) else if (tag == "foregroundColor") // same as "color" ? e.skipCurrentElement(); else if (tag == "frame") { - t->setFrameType(e.readBool() ? FrameType::SQUARE : FrameType::NO_FRAME); + t->setFrameType(e.readBool() ? FrameType::RECTANGLE : FrameType::NO_FRAME); t->setPropertyFlags(Pid::FRAME_TYPE, PropertyFlags::UNSTYLED); } else if (tag == "halign") { @@ -583,7 +583,7 @@ static void readFingering114(XmlReader& e, Fingering* fing) if (isStringNumber) //default value is circle for stringnumber, square is set in tag circle fing->setFrameType(FrameType::CIRCLE); else //default value is square for stringnumber, circle is set in tag circle - fing->setFrameType(FrameType::SQUARE); + fing->setFrameType(FrameType::RECTANGLE); else fing->setFrameType(FrameType::NO_FRAME); } @@ -592,7 +592,7 @@ static void readFingering114(XmlReader& e, Fingering* fing) if (circle) fing->setFrameType(FrameType::CIRCLE); else - fing->setFrameType(FrameType::SQUARE); + fing->setFrameType(FrameType::RECTANGLE); } else { e.skipCurrentElement(); diff --git a/libmscore/read206.cpp b/libmscore/read206.cpp index 083fc8e94d00c..0671b3a4c8a42 100644 --- a/libmscore/read206.cpp +++ b/libmscore/read206.cpp @@ -252,15 +252,15 @@ void readTextStyle206(MStyle* style, XmlReader& e, std::mapsetFrameType(e.readBool() ? FrameType::SQUARE : FrameType::NO_FRAME); + t->setFrameType(e.readBool() ? FrameType::RECTANGLE : FrameType::NO_FRAME); t->setPropertyFlags(Pid::FRAME_TYPE, PropertyFlags::UNSTYLED); } else if (tag == "frameRound") @@ -1331,7 +1331,7 @@ static bool readTextProperties206(XmlReader& e, TextBase* t) t->setFrameType(FrameType::CIRCLE); else { if (t->circle()) - t->setFrameType(FrameType::SQUARE); + t->setFrameType(FrameType::RECTANGLE); } t->setPropertyFlags(Pid::FRAME_TYPE, PropertyFlags::UNSTYLED); } diff --git a/libmscore/scorefile.cpp b/libmscore/scorefile.cpp index 61e89ed2c2b17..a2c69c7676be2 100644 --- a/libmscore/scorefile.cpp +++ b/libmscore/scorefile.cpp @@ -246,7 +246,7 @@ void Score::writeMovement(XmlWriter& xml, bool selectionOnly) xml.setCurTrack(-1); if (isMaster()) { if (!selectionOnly) { - for (const Excerpt* excerpt : excerpts()) { + for (Excerpt*& excerpt : excerpts()) { if (excerpt->partScore() != this) excerpt->partScore()->write(xml, false); // recursion } diff --git a/libmscore/style.cpp b/libmscore/style.cpp index cca82d4b61cde..55165d3c23245 100644 --- a/libmscore/style.cpp +++ b/libmscore/style.cpp @@ -994,7 +994,7 @@ static const StyleType styleTypes[] { { Sid::rehearsalMarkFontStyle, "rehearsalMarkFontStyle", int(FontStyle::Bold) }, { Sid::rehearsalMarkColor, "rehearsalMarkColor", QColor(0, 0, 0, 255) }, { Sid::rehearsalMarkAlign, "rehearsalMarkAlign", QVariant::fromValue(Align::HCENTER | Align::BASELINE) }, - { Sid::rehearsalMarkFrameType, "rehearsalMarkFrameType", int(FrameType::SQUARE) }, + { Sid::rehearsalMarkFrameType, "rehearsalMarkFrameType", int(FrameType::RECTANGLE) }, { Sid::rehearsalMarkFramePadding, "rehearsalMarkFramePadding", 0.5 }, { Sid::rehearsalMarkFrameWidth, "rehearsalMarkFrameWidth", 0.16 }, { Sid::rehearsalMarkFrameRound, "rehearsalMarkFrameRound", 0 }, diff --git a/libmscore/textbase.cpp b/libmscore/textbase.cpp index 4b53c0affa108..4c58f825b9087 100644 --- a/libmscore/textbase.cpp +++ b/libmscore/textbase.cpp @@ -1896,7 +1896,7 @@ void TextBase::layoutFrame() else frame = bbox(); - if (square()) { + if (rectangle()) { #if 0 // "real" square if (frame.width() > frame.height()) { @@ -1908,8 +1908,8 @@ void TextBase::layoutFrame() frame.adjust(-w * .5, 0.0, w * .5, 0.0); } #else - // make sure width >= height - if (frame.height() > frame.width()) { + // make sure width >= height and only a single line (so basically square for single characters) + if (frame.height() > frame.width() && rows() == 1) { qreal w = frame.height() - frame.width(); frame.adjust(-w * .5, 0.0, w * .5, 0.0); } diff --git a/libmscore/textbase.h b/libmscore/textbase.h index 56e9a1201c2e1..39225d7ffe776 100644 --- a/libmscore/textbase.h +++ b/libmscore/textbase.h @@ -30,7 +30,7 @@ class ChangeText; //--------------------------------------------------------- enum class FrameType : char { - NO_FRAME, SQUARE, CIRCLE + NO_FRAME, RECTANGLE, CIRCLE }; //--------------------------------------------------------- @@ -389,7 +389,7 @@ class TextBase : public Element { // helper functions bool hasFrame() const { return _frameType != FrameType::NO_FRAME; } bool circle() const { return _frameType == FrameType::CIRCLE; } - bool square() const { return _frameType == FrameType::SQUARE; } + bool rectangle() const { return _frameType == FrameType::RECTANGLE; } Tid tid() const { return _tid; } void setTid(Tid id) { _tid = id; } diff --git a/mscore/editstyle.cpp b/mscore/editstyle.cpp index db54e78e0d103..66ef007bf6b24 100644 --- a/mscore/editstyle.cpp +++ b/mscore/editstyle.cpp @@ -589,7 +589,7 @@ EditStyle::EditStyle(Score* s, QWidget* parent) textStyleFrameType->clear(); textStyleFrameType->addItem(tr("None", "no frame for text"), int(FrameType::NO_FRAME)); - textStyleFrameType->addItem(tr("Rectangle"), int(FrameType::SQUARE)); + textStyleFrameType->addItem(tr("Rectangle"), int(FrameType::RECTANGLE)); textStyleFrameType->addItem(tr("Circle"), int(FrameType::CIRCLE)); resetTextStyleName->setIcon(*icons[int(Icons::reset_ICON)]); diff --git a/mscore/file.cpp b/mscore/file.cpp index eab009f88ed92..4f7d2be9a6c61 100644 --- a/mscore/file.cpp +++ b/mscore/file.cpp @@ -746,7 +746,7 @@ MasterScore* MuseScore::getNewFile() if (i == 0) tick = Fraction(0,1); QList puRests; - for (Score* _score : score->scoreList()) { + for (Score*& _score : score->scoreList()) { Rest* rest = 0; Measure* measure = new Measure(_score); measure->setTimesig(timesig); @@ -2412,7 +2412,7 @@ Score::FileError readScore(MasterScore* score, QString name, bool ignoreVersionE } score->rebuildMidiMapping(); score->setSoloMute(); - for (Score* s : score->scoreList()) { + for (Score*& s : score->scoreList()) { s->setPlaylistDirty(); s->addLayoutFlags(LayoutFlag::FIX_PITCH_VELO); s->setLayoutAll(); @@ -3060,7 +3060,7 @@ bool MuseScore::saveSvg(Score* score, QIODevice* device, int pageNumber, bool dr int lastNoteIndex = -1; for (int i = 0; i < pageNumber; ++i) { - for (const Element* element : score->pages()[i]->elements()) { + for (Element*& element : score->pages()[i]->elements()) { if (element->type() == ElementType::NOTE) { lastNoteIndex++; } diff --git a/mscore/inspector/inspectorTextBase.cpp b/mscore/inspector/inspectorTextBase.cpp index 2d420dc6d7dd8..04e081761842f 100644 --- a/mscore/inspector/inspectorTextBase.cpp +++ b/mscore/inspector/inspectorTextBase.cpp @@ -12,9 +12,9 @@ #include "inspector.h" #include "inspectorTextBase.h" -#include "libmscore/text.h" + #include "libmscore/score.h" -#include "icons.h" +#include "libmscore/textbase.h" namespace Ms { @@ -52,7 +52,7 @@ InspectorTextBase::InspectorTextBase(QWidget* parent) QComboBox* b = t.frameType; b->clear(); b->addItem(b->QObject::tr("None", "no frame for text"), int(FrameType::NO_FRAME)); - b->addItem(b->QObject::tr("Rectangle"), int(FrameType::SQUARE)); + b->addItem(b->QObject::tr("Rectangle"), int(FrameType::RECTANGLE)); b->addItem(b->QObject::tr("Circle"), int(FrameType::CIRCLE)); connect(t.resetToStyle, SIGNAL(clicked()), SLOT(resetToStyle()));