@@ -4043,9 +4043,7 @@ void Score::updateBracesAndBarlines(Part* part, size_t newIndex)
4043
4043
auto updateBracketSpan = [this , part](size_t modIndex, size_t refIndex) {
4044
4044
Staff* modStaff = staff (part->staves ()[modIndex]->idx ());
4045
4045
Staff* refStaff = staff (part->staves ()[refIndex]->idx ());
4046
- if (modStaff->getProperty (Pid::STAFF_BARLINE_SPAN) != refStaff->getProperty (Pid::STAFF_BARLINE_SPAN)) {
4047
- modStaff->undoChangeProperty (Pid::STAFF_BARLINE_SPAN, refStaff->getProperty (Pid::STAFF_BARLINE_SPAN));
4048
- }
4046
+ modStaff->undoChangeProperty (Pid::STAFF_BARLINE_SPAN, refStaff->getProperty (Pid::STAFF_BARLINE_SPAN));
4049
4047
};
4050
4048
4051
4049
if (newIndex >= 2 ) {
@@ -4055,8 +4053,9 @@ void Score::updateBracesAndBarlines(Part* part, size_t newIndex)
4055
4053
if (part->nstaves () == 2 ) {
4056
4054
const InstrumentTemplate* tp = searchTemplate (part->instrumentId ());
4057
4055
if (tp) {
4058
- if (tp->barlineSpan [0 ] > 0 ) {
4059
- staff (part->staves ()[0 ]->idx ())->undoChangeProperty (Pid::STAFF_BARLINE_SPAN, tp->barlineSpan [0 ]);
4056
+ const bool firstStaffBarLineSpan = tp->barlineSpan [0 ];
4057
+ if (firstStaffBarLineSpan) {
4058
+ staff (part->staff (0 )->idx ())->undoChangeProperty (Pid::STAFF_BARLINE_SPAN, firstStaffBarLineSpan);
4060
4059
}
4061
4060
if (noBracesFound && (tp->bracket [0 ] != BracketType::NO_BRACKET)) {
4062
4061
undoAddBracket (part->staves ()[0 ], 0 , tp->bracket [0 ], part->nstaves ());
@@ -4145,8 +4144,8 @@ void Score::remapBracketsAndBarlines()
4145
4144
// Look in the masterScore for all the staves spanned by a common barline.
4146
4145
// If at least one of them is also in this score, then connect it through.
4147
4146
bool extendBarline = false ;
4148
- int span = masterStaff->barLineSpan ();
4149
- while (!extendBarline && span > 0 && masterStaff->idx () + 1 < master->nstaves ()) {
4147
+ bool span = masterStaff->barLineSpan ();
4148
+ while (!extendBarline && span && masterStaff->idx () + 1 < master->nstaves ()) {
4150
4149
masterStaff = masterScore ()->staff (masterStaff->idx () + 1 );
4151
4150
span = masterStaff->barLineSpan ();
4152
4151
if (masterStaff->findLinkedInScore (this )) {
@@ -4155,7 +4154,7 @@ void Score::remapBracketsAndBarlines()
4155
4154
}
4156
4155
}
4157
4156
if (extendBarline) {
4158
- staff->setBarLineSpan (1 );
4157
+ staff->setBarLineSpan (true );
4159
4158
}
4160
4159
}
4161
4160
}
0 commit comments