-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #273256, fix #273266: special characters dialog fixes
A number of small issues prevent the special characters dialog from working properly, especially for chord symbols. Drag and drop only works with some symbols because FSYMBOL was missing in the switch statements in dragdrop.cpp. Text elements can handle drop of FSYMBOL (which is why double-click works), but they weren't getting to chance during drag&drop. Fix was just adding those case statements. For Harmony objects, we also needed to add the handlers in acceptDrop() and drop() (the latter just passing through to TextBase). However, accidentals require special handling in Harmony::endEdit() in order to parse. Code was added recently to do this, but it didn't actually work (I suspect it did when written, but things changed between then and when it was merged). I rearranged the code in in Harmony::endEdit() a bit - and added comments to explain. Basically, setHarmony() needs to be called *after* the back-substitution (replacing flat with "b", sharp with "#"), but the back-substitution needs to happen after TextBase::endEdit() finalizes the text (actually, if it were possible to substitute before, that would be better, but do to the way the undo records are munged in TextBase::endEdit(), it seemed to dangerous to even try). Bottom line: I do the TextBase::endEdit(), then the back-substitution, then the setHarmony(). I needed to be sure to trigger a layout, which required a startCmd/endCmd pair (since TextBase::endEdit() already called endCmd).
- Loading branch information
1 parent
b7824c8
commit 563cd5d
Showing
2 changed files
with
64 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters