Fix #23538: update accidentals when tie is deleted #545
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.
UPDATED: This is to fix #23538 (formerly #12116):
Added call to updateAccidentals() in Chord::remove(Element_) and Note::remove(Element_) to make sure, notes which are no longer tied back get needed accidentals. This was the described issue #23538.
Let RemoveElement::undo() reset the tieBack property of the tie's endNote when restoring a removed tie, to avoid crashes.
Added a call to updateAccidentals() for the end measure of a tie being removed in RemoveElement::redo():
Example: Key signature of F major, a B nat is tied to the next measure which contains a second B nat.
This second B nat needs an accidental because the tied note doesn't have one. If the tie is removed, the first note gets a natural and now the second one does no longer need one. Therefore we need to check the measure of the last note of the tie.