diff --git a/importexport/musicxml/exportxml.cpp b/importexport/musicxml/exportxml.cpp index b3621d04090ce..da0d1ccbbdf5a 100644 --- a/importexport/musicxml/exportxml.cpp +++ b/importexport/musicxml/exportxml.cpp @@ -313,7 +313,7 @@ struct MeasurePrintContext final // ExportMusicXml //--------------------------------------------------------- -typedef QHash TrillHash; +typedef std::unordered_map TrillHash; typedef std::map MxmlInstrumentMap; class ExportMusicXml { @@ -354,10 +354,8 @@ class ExportMusicXml { void calcDivMoveToTick(const Fraction& t); void calcDivisions(); void keysigTimesig(const Measure* m, const Part* p); - void chordAttributes(Chord* chord, Notations& notations, Technical& technical, - TrillHash& trillStart, TrillHash& trillStop); - void wavyLineStartStop(const ChordRest* const cr, Notations& notations, Ornaments& ornaments, - TrillHash& trillStart, TrillHash& trillStop); + void chordAttributes(Chord* chord, Notations& notations, Technical& technical, TrillHash& trillStart, TrillHash& trillStop); + void wavyLineStartStop(const ChordRest* cr, Notations& notations, Ornaments& ornaments, TrillHash& trillStart, TrillHash& trillStop); void print(const Measure* const m, const int partNr, const int firstStaffOfPart, const int nrStavesInPart, const MeasurePrintContext& mpc); void findAndExportClef(const Measure* const m, const int staves, const int strack, const int etrack); void exportDefaultClef(const Part* const part, const Measure* const m); @@ -1005,8 +1003,8 @@ static void findTrills(const Measure* const measure, int strack, int etrack, Tri Element* elem2 = tr->endElement(); if (elem1 && elem1->isChordRest() && elem2 && elem2->isChordRest()) { - trillStart.insert(toChordRest(elem1), tr); - trillStop.insert(toChordRest(elem2), tr); + trillStart.insert({ toChordRest(elem1), tr }); + trillStop.insert({ toChordRest(elem2), tr }); } } } @@ -2630,11 +2628,11 @@ static void wavyLineStop(const Trill* tr, const int number, Notations& notations // wavyLineStartStop //--------------------------------------------------------- -void ExportMusicXml::wavyLineStartStop(const ChordRest* const cr, Notations& notations, Ornaments& ornaments, +void ExportMusicXml::wavyLineStartStop(const ChordRest* cr, Notations& notations, Ornaments& ornaments, TrillHash& trillStart, TrillHash& trillStop) { - if (trillStart.contains(cr) && trillStop.contains(cr)) { - const Trill* tr = trillStart.value(cr); + if (mu::contains(trillStart, cr) && mu::contains(trillStop, cr)) { + const Trill* tr = trillStart.at(cr); int n = findTrill(0); if (n >= 0) { wavyLineStart(tr, n, notations, ornaments, _xml); @@ -2645,8 +2643,8 @@ void ExportMusicXml::wavyLineStartStop(const ChordRest* const cr, Notations& not cr, cr->staffIdx(), cr->tick().ticks()); } else { - if (trillStop.contains(cr)) { - const Trill* tr = trillStop.value(cr); + if (mu::contains(trillStop, cr)) { + const Trill* tr = trillStop.at(cr); int n = findTrill(tr); if (n >= 0) // trill stop after trill start @@ -2663,10 +2661,10 @@ void ExportMusicXml::wavyLineStartStop(const ChordRest* const cr, Notations& not if (n >= 0) { wavyLineStop(tr, n, notations, ornaments, _xml); } - trillStop.remove(cr); + mu::remove(trillStop, cr); } - if (trillStart.contains(cr)) { - const Trill* tr = trillStart.value(cr); + if (mu::contains(trillStart, cr)) { + const Trill* tr = trillStart.at(cr); int n = findTrill(tr); if (n >= 0) qDebug("wavyLineStartStop error"); @@ -2679,7 +2677,7 @@ void ExportMusicXml::wavyLineStartStop(const ChordRest* const cr, Notations& not else qDebug("too many overlapping trills (cr %p staff %d tick %d)", cr, cr->staffIdx(), cr->tick().ticks()); - trillStart.remove(cr); + mu::remove(trillStart, cr); } } }