Skip to content

Commit

Permalink
[musicxml] Replaced QPair to std::pair
Browse files Browse the repository at this point in the history
Backport of musescore#21236, part 3
  • Loading branch information
igorkorsukov authored and Jojo-Schmitz committed Sep 5, 2024
1 parent aa6c7cb commit 447899e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions importexport/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ static void handleSpannerStart(SLine* new_sp, int track, QString placement, cons
//qDebug("handleSpannerStart(sp %p, track %d, tick %s (%d))", new_sp, track, qPrintable(tick.print()), tick.ticks());
new_sp->setTrack(track);
setSLinePlacement(new_sp, placement);
spanners[new_sp] = QPair<int, int>(tick.ticks(), -1);
spanners[new_sp] = std::pair<int, int>(tick.ticks(), -1);
}

//---------------------------------------------------------
Expand Down Expand Up @@ -4131,13 +4131,13 @@ double MusicXMLParserDirection::convertTextToNotes()
static const QRegularExpression notesRegex("(?<note>[yxeqhwW]\\.{0,2})((?:\\s|\u00A0)*=)");
QString notesSubstring = notesRegex.match(_wordsText).captured("note");

std::vector<QPair<QString, QString>> noteSyms{{"q", QString("<sym>metNoteQuarterUp</sym>")}, // note4_Sym
{"e", QString("<sym>metNote8thUp</sym>")}, // note8_Sym
{"h", QString("<sym>metNoteHalfUp</sym>")}, // note2_Sym
{"y", QString("<sym>metNote32ndUp</sym>")}, // note32_Sym
{"x", QString("<sym>metNote16thUp</sym>")}, // note16_Sym
{"w", QString("<sym>metNoteWhole</sym>")},
{"W", QString("<sym>metNoteDoubleWhole</sym>")}};
std::vector<std::pair<QString, QString>> noteSyms{{"q", QString("<sym>metNoteQuarterUp</sym>")}, // note4_Sym
{"e", QString("<sym>metNote8thUp</sym>")}, // note8_Sym
{"h", QString("<sym>metNoteHalfUp</sym>")}, // note2_Sym
{"y", QString("<sym>metNote32ndUp</sym>")}, // note32_Sym
{"x", QString("<sym>metNote16thUp</sym>")}, // note16_Sym
{"w", QString("<sym>metNoteWhole</sym>")},
{"W", QString("<sym>metNoteDoubleWhole</sym>")}};
for (auto noteSym : noteSyms) {
if (notesSubstring.contains(noteSym.first)) {
notesSubstring.replace(noteSym.first, noteSym.second);
Expand Down Expand Up @@ -7715,7 +7715,7 @@ static void addGlissandoSlide(const Notation& notation, Note* note,
gliss->setLineColor(glissandoColor);
gliss->setText(glissandoText);
gliss->setGlissandoType(glissandoTag == 0 ? GlissandoType::STRAIGHT : GlissandoType::WAVY);
spanners[gliss] = QPair<int, int>(tick.ticks(), -1);
spanners[gliss] = std::pair<int, int>(tick.ticks(), -1);
// qDebug("glissando/slide=%p inserted at first tick %d", gliss, tick);
}
}
Expand Down Expand Up @@ -7871,11 +7871,11 @@ static void addWavyLine(ChordRest* cr, const Fraction& tick,
trill = new Trill(cr->score());
trill->setTrack(trk);
if (wavyLineType == "start") {
spanners[trill] = QPair<int, int>(tick.ticks(), -1);
spanners[trill] = std::pair<int, int>(tick.ticks(), -1);
// qDebug("trill=%p inserted at first tick %d", trill, tick);
}
if (wavyLineType == "startstop") {
spanners[trill] = QPair<int, int>(tick.ticks(), tick.ticks() + ticks.ticks());
spanners[trill] = std::pair<int, int>(tick.ticks(), tick.ticks() + ticks.ticks());
trill = nullptr;
// qDebug("trill=%p inserted at first tick %d second tick %d", trill, tick, tick);
}
Expand Down
2 changes: 1 addition & 1 deletion importexport/musicxml/musicxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class SlurDesc {
//---------------------------------------------------------

typedef std::vector<MusicXmlPartGroup*> MusicXmlPartGroupList;
typedef std::map<SLine*, QPair<int, int> > MusicXmlSpannerMap;
typedef std::map<SLine*, std::pair<int, int> > MusicXmlSpannerMap;

} // namespace Ms
#endif
2 changes: 1 addition & 1 deletion importexport/musicxml/musicxmlsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Ms {
List of note start/stop times in a voice in a single staff.
*/

typedef QPair<int, int> StartStop;
typedef std::pair<int, int> StartStop;
typedef std::vector<StartStop> StartStopList;

//---------------------------------------------------------
Expand Down

0 comments on commit 447899e

Please sign in to comment.