Hairpin: when copied, all custom settings are lost and the element resets to default

• Jan 16, 2020 - 11:29
Reported version
3.3
Priority
P2 - Medium
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.3.4.9066, revision: 7684abe

  1. In Format > Style > Hairpins, ensure that "Placement" is set to the system default, "Below."
  2. Create a hairpin and set its placement to "Above" in the Inspector.
  3. Now copy the hairpin to another part of the score.

Expected result: The copied hairpin should also be above the staff.
Actual result: The hairpin reverts to the default "Below" setting.


Comments

Title Hairpin placement resets to default when copied Hairpin: when copied, all custom settings are lost and the element resets to default

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.4.2.9788, revision: 148e43f

On further investigation, it turns out that all customisation is lost when a hairpin is copied: placement, custom length, text, diagonal setting etc.

Status active PR created

See https://github.com/musescore/MuseScore/pull/5743.

There are 3 cases to consider here, differentiated by what has been copied:
1. a range selection containing one or more hairpins
2. a single selection consisting of a hairpin
3. a list selection containing one or more hairpins.

Case 1 is already handled correctly. This issue applies to case 2 and case 3, which are similar to each other, but are handled separately. The relevant code for case 2 is in ChordRest::drop(), and the relevant code for case 3 is in Score::pasteSymbols(). Both of these functions disregard the customization of the hairpin that is available to them, and instead use the Score::addHairpin() function to add a fresh new hairpin to the score, for no reason that I can see. The fix is to not use Score::addHairpin(), but rather add a hairpin to the score that has all of the properties of the original element.

Fix version
3.5.0