diff --git a/importexport/musicxml/importmxmlnoteduration.cpp b/importexport/musicxml/importmxmlnoteduration.cpp index 744f26e7ca47c..5adcf1cef88c5 100644 --- a/importexport/musicxml/importmxmlnoteduration.cpp +++ b/importexport/musicxml/importmxmlnoteduration.cpp @@ -219,7 +219,7 @@ bool mxmlNoteDuration::readProperties(QXmlStreamReader& e) //qDebug("tag %s", qPrintable(tag.toString())); if (tag == "dot") { _dots++; - e.readNext(); + e.skipCurrentElement(); // skip but don't log return true; } else if (tag == "duration") { diff --git a/importexport/musicxml/importmxmlpass1.cpp b/importexport/musicxml/importmxmlpass1.cpp index 2340df4774711..ac06c2bf877c8 100644 --- a/importexport/musicxml/importmxmlpass1.cpp +++ b/importexport/musicxml/importmxmlpass1.cpp @@ -387,7 +387,7 @@ bool MusicXMLParserPass1::determineStaffMoveVoice(const QString& id, const int m // make score-relative instead on part-relative Part* part = _partMap.value(id); if (!part) - return -1; + return false; int scoreRelStaff = _score->staffIdx(part); // zero-based number of parts first staff in the score msTrack = (scoreRelStaff + s) * VOICES; @@ -3263,17 +3263,17 @@ void MusicXMLParserPass1::note(const QString& partId, } else if (_e.name() == "chord") { chord = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "cue") _e.skipCurrentElement(); // skip but don't log else if (_e.name() == "grace") { grace = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "instrument") { instrId = _e.attributes().value("id").toString(); - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "lyric") { const auto number = _e.attributes().value("number").toString(); @@ -3388,13 +3388,13 @@ void MusicXMLParserPass1::notePrintSpacingNo(Fraction& dura) while (_e.readNextStartElement()) { if (_e.name() == "chord") { chord = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "duration") duration(dura); else if (_e.name() == "grace") { grace = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else _e.skipCurrentElement(); // skip but don't log diff --git a/importexport/musicxml/importmxmlpass2.cpp b/importexport/musicxml/importmxmlpass2.cpp index c81b56e6d8085..5d349aaf93667 100644 --- a/importexport/musicxml/importmxmlpass2.cpp +++ b/importexport/musicxml/importmxmlpass2.cpp @@ -5471,20 +5471,20 @@ Note* MusicXMLParserPass2::note(const QString& partId, beam(beamTypes); else if (_e.name() == "chord") { chord = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "cue") { cue = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "grace") { grace = true; graceSlash = _e.attributes().value("slash") == "yes"; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "instrument") { instrumentId = _e.attributes().value("id").toString(); - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "lyric") { // lyrics on grace notes not (yet) supported by MuseScore @@ -5861,13 +5861,13 @@ void MusicXMLParserPass2::notePrintSpacingNo(Fraction& dura) while (_e.readNextStartElement()) { if (_e.name() == "chord") { chord = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "duration") duration(dura); else if (_e.name() == "grace") { grace = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else _e.skipCurrentElement(); // skip but don't log @@ -6485,7 +6485,7 @@ void MusicXMLParserLyric::parse() else if (_e.name() == "extend") { hasExtend = true; extendType = _e.attributes().value("type").toString(); - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "syllabic") { auto syll = _e.readElementText(); @@ -6565,7 +6565,7 @@ void MusicXMLParserNotations::slur() _slurStart = true; } - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } //--------------------------------------------------------- @@ -6676,7 +6676,7 @@ void MusicXMLParserNotations::tied() _logger->logError(QString("unknown tied type %1").arg(tiedType), &_e); } - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } //--------------------------------------------------------- @@ -6696,7 +6696,7 @@ void MusicXMLParserNotations::dynamics() _dynamicsList.push_back(_e.readElementText()); else { _dynamicsList.push_back(_e.name().toString()); - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } } } @@ -6720,8 +6720,7 @@ void MusicXMLParserNotations::articulations() Notation artic = Notation::notationWithAttributes(_e.name().toString(), _e.attributes(), "articulations", id); _notations.push_back(artic); - _e.readNext(); - continue; + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "breath-mark") { _breath = SymId::breathMarkComma; @@ -6730,7 +6729,7 @@ void MusicXMLParserNotations::articulations() } else if (_e.name() == "caesura") { _breath = SymId::caesura; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "doit" || _e.name() == "falloff" @@ -6740,7 +6739,7 @@ void MusicXMLParserNotations::articulations() _e.attributes(), "articulations"); artic.setSubType(_e.name().toString()); _notations.push_back(artic); - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else { skipLogCurrElem(); @@ -6766,12 +6765,11 @@ void MusicXMLParserNotations::ornaments() Notation notation = Notation::notationWithAttributes(_e.name().toString(), _e.attributes(), "articulations", id); _notations.push_back(notation); - _e.readNext(); - continue; + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "trill-mark") { trillMark = true; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "wavy-line") { auto wavyLineTypeWasStart = (_wavyLineType == "start"); @@ -6788,7 +6786,7 @@ void MusicXMLParserNotations::ornaments() if (wavyLineTypeWasStart && _wavyLineType == "stop") { _wavyLineType = "startstop"; } - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "tremolo") { _tremoloType = _e.attributes().value("type").toString(); @@ -6827,8 +6825,7 @@ void MusicXMLParserNotations::technical() Notation notation = Notation::notationWithAttributes(_e.name().toString(), _e.attributes(), "technical", id); _notations.push_back(notation); - _e.readNext(); - continue; + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "fingering" || _e.name() == "fret" || _e.name() == "pluck" || _e.name() == "string") { Notation notation = Notation::notationWithAttributes(_e.name().toString(), @@ -6838,7 +6835,6 @@ void MusicXMLParserNotations::technical() } else if (_e.name() == "harmonic") { harmonic(); - _e.readNext(); } else { skipLogCurrElem(); @@ -6863,7 +6859,7 @@ void MusicXMLParserNotations::harmonic() QString name = _e.name().toString(); if (name == "natural") { notation.setSubType(name); - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else { // TODO: add artificial harmonic when supported by musescore _logger->logError(QString("unsupported harmonic type/pitch '%1'").arg(name), &_e); @@ -7403,7 +7399,7 @@ void MusicXMLParserNotations::parse() if (_e.name() == "arpeggiate") { _arpeggioType = _e.attributes().value("direction").toString(); if (_arpeggioType == "") _arpeggioType = "none"; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "articulations") { articulations(); @@ -7419,7 +7415,7 @@ void MusicXMLParserNotations::parse() } else if (_e.name() == "non-arpeggiate") { _arpeggioType = "non-arpeggiate"; - _e.readNext(); + _e.skipCurrentElement(); // skip but don't log } else if (_e.name() == "ornaments") { ornaments();