Skip to content

Commit

Permalink
Follow MusicXML specs: Only output blank pages if new-page="yes"
Browse files Browse the repository at this point in the history
  • Loading branch information
th-we committed Dec 18, 2023
1 parent 39ba8db commit 65b5448
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/iomusxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3694,14 +3694,12 @@ void MusicXmlInput::ReadMusicXmlPrint(pugi::xml_node node, Section *section)
assert(node);
assert(section);

int pageBreaks = node.attribute("blank-page").as_int();
if (node.attribute("new-page").as_bool() || pageBreaks > 0) {
pageBreaks++;
}

for (int i = 0; i < pageBreaks; i++) {
Pb *pb = new Pb();
section->AddChild(pb);
if (node.attribute("new-page").as_bool()) {
int pageBreaks = node.attribute("blank-page").as_int() + 1;
for (int i = 0; i < pageBreaks; ++i) {
Pb *pb = new Pb();
section->AddChild(pb);
}
}

if (node.attribute("new-system").as_bool()) {
Expand Down

0 comments on commit 65b5448

Please sign in to comment.