In Writer, using kmfl which works by DeleteSurrounding, the composing characters that are supposed to be deleted in an editeng textbox or shape are not deleted. This started in LO 7.1 with commit b9405fbc4e19901c78d136895c5ab0437d8450ac Author: Caolán McNamara on Sun Oct 25 15:27:58 2020 +0000 Resolves: tdf#137620 add DeleteSurroundingText at vcl::Window level See bug 137620 comment 0 about setting up kmfl/ibus, and to see what this issue is about in general. Steps to reproduce (with kmfl / GE.kmn enabled) 1.) Insert textbox 2.) In the textbox, type ";n", or ";;~a". The composing characters should be removed, leaving on the complex character "ŋ" or "ä̃". P.S. That fix solved the same problem for draw comments (bug 96805 comment 9) and Writer tables (bug 137620 comment 23) among others, so make sure to test any changes against at least those two.
It DOES work in a Draw textbox, or a Draw shape. It also works in a Calc textbox and a Calc shape.
Created attachment 172887 [details] 142852_bt.txt: backtrace (which doesn't look very helpful to me....) After typing ";n" I get: MYDEBUG:vcl/unx/gtk3/gtkframe.cxx:5141: ::CalcDeleteSurroundingSelection cursorIndex[0] text[] offset[-1] Chars[1] warn:vcl.gtk:126967:126967:vcl/unx/gtk3/gtkframe.cxx:5167: IM delete-surrounding, unable to move to offset: -1
If I basically "revert" GtkSalFrame::CalcDeleteSurroundingSelection in the case where offset == -1, then it works. Otherwise, it calls SwEditWin::GetSurroundingText and HasSelection, even though the text is just "". (Why no text seen?). SwEditWin is final, so it can't be a class override issue. I don't know where else I can go now. If I can't even see the text that is supposed to be deleted, then I'm totally lost in trying to help any further.
I think in the writer case we are entering SwEditWin::GetSurroundingText but that isn't considering this draw editengine case so we get the selection of the ordinary document, which is empty
Caolán McNamara committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/216a43bc1799221d53e1f3a590309aaa63b6c9dd tdf#142852 forward surrounding-text requests to an active drawing editengine It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/d7b9b9e8e02aefd61669e07543fc370b0c58207f tdf#142852 forward surrounding-text requests to an active drawing editengine It will be available in 7.2.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
looking good, backport to 7-1 in gerrit also
Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/f3adb19b4e4f4e26aee50ce1d7cbc7a916253c04 tdf#142852 forward surrounding-text requests to an active drawing editengine It will be available in 7.1.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks for your expertise Caolán.