From 6051c8ecead8f8e62418ea8d29f18b01fc46ead4 Mon Sep 17 00:00:00 2001 From: Klaus Rettinghaus Date: Mon, 6 May 2024 11:30:21 +0200 Subject: [PATCH] allow use-symbols to be set to no explicitly --- src/iomusxml.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/iomusxml.cpp b/src/iomusxml.cpp index 667e4d99a68..a7bb45ee05c 100644 --- a/src/iomusxml.cpp +++ b/src/iomusxml.cpp @@ -1658,9 +1658,17 @@ bool MusicXmlInput::ReadMusicXmlMeasure( for (pugi::xml_node::iterator it = node.begin(); it != node.end(); ++it) { // first check if there is a multi measure rest if (it->select_node(".//multiple-rest")) { - const int multiRestLength = it->select_node(".//multiple-rest").node().text().as_int(); + const pugi::xml_node multiRestNode = it->select_node(".//multiple-rest").node(); + const int multiRestLength = multiRestNode.text().as_int(); + const std::string symbols = multiRestNode.attribute("use-symbols").as_string(); MultiRest *multiRest = new MultiRest; - if (it->select_node(".//multiple-rest[@use-symbols='yes']")) multiRest->SetBlock(BOOLEAN_false); + if (symbols == "no") { + // default by MusicXML specification + multiRest->SetBlock(BOOLEAN_true); + } + else if (symbols == "yes") { + multiRest->SetBlock(BOOLEAN_false); + } multiRest->SetNum(multiRestLength); Layer *layer = SelectLayer(1, measure); AddLayerElement(layer, multiRest);