Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2107 from MarcSabatella/60791-timesig-link-staff
fix #60791: timesig change deletes voices 2-4 in linked staves
  • Loading branch information
lasconic committed Jul 7, 2015
2 parents a34fdf5 + 990c792 commit a1dc572
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libmscore/excerpt.cpp
Expand Up @@ -812,7 +812,7 @@ void cloneStaff(Staff* srcStaff, Staff* dstStaff)

//---------------------------------------------------------
// cloneStaff2
// staves are in different scores
// staves are potentially in different scores
//---------------------------------------------------------

void cloneStaff2(Staff* srcStaff, Staff* dstStaff, int stick, int etick)
Expand Down
10 changes: 6 additions & 4 deletions libmscore/range.cpp
Expand Up @@ -460,10 +460,11 @@ bool TrackList::write(Measure* measure) const
//

for (Segment* s = measure->first(); s; s = s->next1()) {
Chord* chord = static_cast<Chord*>(s->element(_track));
if (chord == 0 || chord->type() != Element::Type::CHORD)
Element* e = s->element(_track);
if (e == 0 || e->type() != Element::Type::CHORD)
continue;
foreach (Note* n, chord->notes()) {
Chord* chord = static_cast<Chord*>(e);
for (Note* n : chord->notes()) {
Tie* tie = n->tieFor();
if (!tie)
continue;
Expand Down Expand Up @@ -550,7 +551,8 @@ bool ScoreRange::write(Score* score, int tick) const
int track = dl->track();
if (!dl->write(score->tick2measure(tick)))
return false;
if ((track % VOICES) == 0) {
if ((track % VOICES) == VOICES - 1) {
// clone staff if appropriate after all voices have been copied
int staffIdx = track / VOICES;
Staff* ostaff = score->staff(staffIdx);
LinkedStaves* linkedStaves = ostaff->linkedStaves();
Expand Down

0 comments on commit a1dc572

Please sign in to comment.