Bug 142852 - KMFL characters are not "swallowed" in a Writer textbox or shapeText
Summary: KMFL characters are not "swallowed" in a Writer textbox or shapeText
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.3.0 target:7.2.0.0.beta2 tar...
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2021-06-14 14:14 UTC by Justin L
Modified: 2021-06-24 04:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
142852_bt.txt: backtrace (which doesn't look very helpful to me....) (3.74 KB, text/plain)
2021-06-15 07:04 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2021-06-14 14:14:18 UTC
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.
Comment 1 Justin L 2021-06-14 14:26:20 UTC
It DOES work in a Draw textbox, or a Draw shape.
It also works in a Calc textbox and a Calc shape.
Comment 2 Justin L 2021-06-15 07:04:11 UTC
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
Comment 3 Justin L 2021-06-15 11:58:44 UTC
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.
Comment 4 Caolán McNamara 2021-06-18 14:38:13 UTC
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
Comment 5 Commit Notification 2021-06-18 19:00:31 UTC
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.
Comment 6 Commit Notification 2021-06-18 19:05:53 UTC
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.
Comment 7 Caolán McNamara 2021-06-18 19:06:53 UTC
looking good, backport to 7-1 in gerrit also
Comment 8 Commit Notification 2021-06-19 20:18:56 UTC
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.
Comment 9 Justin L 2021-06-24 04:03:31 UTC
Thanks for your expertise Caolán.