diff --git a/src/importexport/musicxml/internal/musicxml/importmxmlpass1.cpp b/src/importexport/musicxml/internal/musicxml/importmxmlpass1.cpp index 020da2bb0a..00ea5b7c43 100644 --- a/src/importexport/musicxml/internal/musicxml/importmxmlpass1.cpp +++ b/src/importexport/musicxml/internal/musicxml/importmxmlpass1.cpp @@ -1088,10 +1088,9 @@ void MusicXMLParserPass1::scorePartwise() // add bracket and set the span // TODO: use group-symbol default-x to determine horizontal order of brackets Staff* staff = il.at(pg->start)->staff(0); - if (pg->type == BracketType::NO_BRACKET) { - staff->setBracketType(0, BracketType::NO_BRACKET); - } else { - staff->addBracket(new BracketItem(staff->score(), pg->type, stavesSpan)); + if (pg->type != BracketType::NO_BRACKET) { + staff->setBracketType(pg->column, pg->type); + staff->setBracketSpan(pg->column, stavesSpan); } if (pg->barlineSpan) { staff->setBarLineSpan(pg->span); @@ -1102,7 +1101,9 @@ void MusicXMLParserPass1::scorePartwise() // multi-staff parts w/o explicit brackets get a brace foreach (Part const* const p, il) { if (p->nstaves() > 1 && !partSet.contains(p)) { - p->staff(0)->addBracket(new BracketItem(p->score(), BracketType::BRACE, p->nstaves())); + const int column = p->staff(0)->bracketLevels() + 1; + p->staff(0)->setBracketType(column, BracketType::BRACE); + p->staff(0)->setBracketSpan(column, p->nstaves()); if (allStaffGroupsIdentical(p)) { // span only if the same types p->staff(0)->setBarLineSpan(p->nstaves()); @@ -1737,6 +1738,7 @@ static void partGroupStart(MusicXmlPartGroupMap& pgs, int n, int p, QString s, b pg->start = p; pg->barlineSpan = barlineSpan, pg->type = bracketType; + pg->column = n; pgs[n] = pg; } diff --git a/src/importexport/musicxml/internal/musicxml/musicxml.h b/src/importexport/musicxml/internal/musicxml/musicxml.h index dfc4b388e1..8f662629f9 100644 --- a/src/importexport/musicxml/internal/musicxml/musicxml.h +++ b/src/importexport/musicxml/internal/musicxml/musicxml.h @@ -42,6 +42,7 @@ struct MusicXmlPartGroup { int start; BracketType type; bool barlineSpan; + int column; }; const int MAX_LYRICS = 16;