Copying note head to rest does not retain note spelling

• Aug 30, 2017 - 17:40
Reported version

See discussion

In summary, if you copy a note such as A# to a rest, it will paste as Bb. This happens with other notes as well.

Expected result is that the spelling will be retained.


The relevant code for this is in ChordRest::drop(). In the switch statement where we handle case Element::Type::NOTE, we should consider the tpc as well. With any luck it's just a matter of setting tpc1 and/or tpc2 in the nval. But see also #5098: Notes not transposed when copied by notehead - we need to be sure to get the transposition correct. So we should look at how that is handled in Note::drop().

Also, we should consider #107231: Pasting notehead onto rest changes rest duration. Right now when pasting a single note onto another note, we keep the existing chordrest duration. But when pasting onto a rest, we actually create a new chord with the duration of the chord the note came from. Seems unnecessarily inconsistent, and aside from possibly being unexpected, that sort of inconsistency contributes to bugs like this where we get the tpc right in one case but not the other. Might be better to just have a single strategy for handling paste of note and apply it in one place.