Fix #30931: Prevent custom Instrument Change text from being reset to default #31276
+28
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: #30931
Summary
This patch fixes the issue where manually edited instrument change text did not persist when the short instrument name was later modified in the staff properties. Now the user-edited text is retained instead of being overwritten by the default instrument name.
What I changed
Added a flag (
m_manualText) insideInstrumentChangeto detect when the text is explicitly edited by the userUpdated the logic in
setupInstrument()to avoid resetting the text if the user has manually edited itModified
setProperty()so that whenPid::TEXTis changed, the text is marked as user-definedI signed the CLA
The title of the PR describes the problem it addresses
Each commit's message describes its purpose and effects, and references the issue it resolves
If changes are extensive, there is a sequence of easily reviewable commits
The code in the PR follows the coding rules
There are no unnecessary changes
The code compiles and runs on my machine, preferably after each commit individually
I created a unit test or vtest to verify the changes I made (if applicable)