Skip to content

Commit

Permalink
fix #45176: bad barline span in parts
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Jan 24, 2015
1 parent 8c2401f commit 148b926
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libmscore/excerpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,18 @@ void cloneStaves(Score* oscore, Score* score, const QList<int>& map)
if (srcStaff->primaryStaff()) {
int span = srcStaff->barLineSpan();
int sIdx = srcStaff->idx();
if (dstStaffIdx == 0 && span == 0) {
// this is first staff of new score,
// but it was somewhere within a barline span in the old score
// so, find beginning of span
for (int i = 0; i <= sIdx; ++i) {
span = oscore->staff(i)->barLineSpan();
if (i + span > sIdx) {
sIdx = i;
break;
}
}
}
int eIdx = sIdx + span;
for (int staffIdx = sIdx; staffIdx < eIdx; ++staffIdx) {
if (!map.contains(staffIdx))
Expand Down

0 comments on commit 148b926

Please sign in to comment.