Skip to content

Commit

Permalink
Merge pull request #4317 from dmitrio95/34426-paste-linked-lyrics
Browse files Browse the repository at this point in the history
fix #34426: Paste chords with lyrics to linked staves correctly
  • Loading branch information
anatoly-os committed Dec 6, 2018
2 parents ce6bdc8 + e0d73e1 commit 55e0dea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libmscore/edit.cpp
Expand Up @@ -4411,6 +4411,16 @@ void Score::undoAddElement(Element* element)
void Score::undoAddCR(ChordRest* cr, Measure* measure, int tick)
{
Q_ASSERT(!cr->isChord() || !(toChord(cr)->notes()).empty());
if (!cr->lyrics().empty()) {
// Add chordrest and lyrics separately for correct
// handling of adding lyrics to linked staves.
std::vector<Lyrics*> lyrics;
std::swap(lyrics, cr->lyrics());
undoAddCR(cr, measure, tick);
for (Lyrics* l : lyrics)
undoAddElement(l);
return;
}

Staff* ostaff = cr->staff();
int strack = ostaff->idx() * VOICES + cr->voice();
Expand Down

0 comments on commit 55e0dea

Please sign in to comment.