Bug 143817 - Search Commands deleting contents in Writer when command applied to selected text
Summary: Search Commands deleting contents in Writer when command applied to selected ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.2.0.0.beta1+
Hardware: All Windows (All)
: medium normal
Assignee: Rafael Lima
URL:
Whiteboard: target:7.4.0 target:7.3.1 target:7.2.6
Keywords:
: 143975 (view as bug list)
Depends on:
Blocks: 91874
  Show dependency treegraph
 
Reported: 2021-08-10 21:51 UTC by Rafael Lima
Modified: 2022-03-03 10:34 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Video showing the bug (1004.80 KB, video/x-matroska)
2021-08-10 21:51 UTC, Rafael Lima
Details
working well (418.70 KB, video/mp4)
2021-08-11 19:40 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2021-08-10 21:51:05 UTC
Created attachment 174197 [details]
Video showing the bug

I was running some tests while writing the help page for the "Search Commands" hud and came across a bug when it is used in Writer (see attached video).

Steps to reproduce:
1) Open Writer and enter some text
2) Select the text
3) Choose a command to apply to the selected text (e.g. "Bold" or "Italic")
4) Press "Enter"
5) Instead of applying the command to the selected text, the text disappears as though when you press Enter on any selected text

However, the expected outcome would be to have the command applied to the selected text without deleting it.

The video was recorded in KDE but I tested this issue both in KDE and Windows using the latest alpha on two different PCs.

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: b2130ad3fda841c68a0436fbddf29bcedede0af5
CPU threads: 16; OS: Linux 5.11; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-08-09_13:03:07
Calc: threaded

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: eeeef98796df322d89912070c8e431c5f6d1283f
CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: pt-BR (pt_BR); UI: pt-BR
Calc: threaded
Comment 1 Rafael Lima 2021-08-10 21:53:35 UTC
Tomaz, I found a possible bug in Search Commands. Could you please take a look? Thanks!
Comment 2 BogdanB 2021-08-11 19:39:09 UTC
I can't confirm with
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: c97bdca2d7abf30a99c45192b8f49c5bf76ca035
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 3 BogdanB 2021-08-11 19:40:28 UTC
Created attachment 174213 [details]
working well
Comment 4 BogdanB 2021-08-11 19:43:40 UTC
I remember sometime ago happend to me, but I don't want to confirm based on my memory. I can NOT reproduce myself now.

Also I can NOT confirm in
Version: 7.2.0.1.0+ / LibreOffice Community
Build ID: 5570795d54a00041a406243b777f0df5f6399b67
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:libreoffice-7-2, Time: 2021-07-15_19:14:35
Calc: threaded
Comment 5 BogdanB 2021-08-18 07:41:47 UTC
Confirm with
Version: 7.2.0.4 (x64) / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ro-RO (ro_RO); UI: en-US
Calc: threaded

Maybe it's a windows ony bug.
Comment 6 BogdanB 2021-08-20 19:15:08 UTC
*** Bug 143975 has been marked as a duplicate of this bug. ***
Comment 7 Rafael Lima 2022-02-18 00:51:38 UTC
Still present in LO 7.4 alpha.

So if I select some text, press Shift+Esc, look up a command such as "Italic" and press Enter, the formatting will be applied but the text will be deleted similarly to when we press Enter with text selected without opening the "Search commands" dialog.

Pressing Ctrl+Z will restore the text with the command applied, meaning that it does apply the command and then delete the text.

Clicking the command will execute it as expected... however this is not productive, since this new feature is keyboard-oriented and most users will want to press Enter after choosing a command.

System info:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 9d50307b2e1fd26d415539d3ed8624c7a449e45b
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: threaded
Comment 8 Rafael Lima 2022-02-18 01:30:37 UTC
@Tomaz, here's a simple fix. Could you please check it?

I tested it locally and it stopped deleting text after the command is executed with the Enter key.

https://gerrit.libreoffice.org/c/core/+/130091
Comment 9 Commit Notification 2022-02-18 04:48:07 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3c94a0f7729f1638ab3b273a186c48de859cfb49

tdf#143817 Fix HUD deleting text contents in Writer

It will be available in 7.4.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 10 Tomaz Vajngerl 2022-02-18 06:11:59 UTC
Nailed it... thanks Rafael.

Returning true or false says if the key was handled or not, so returning false meant that the key event was sent forward to other handlers.
Comment 11 Commit Notification 2022-02-18 08:02:20 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/4886374fca8f17de78ae558033aa677bcefc0a4e

tdf#143817 Fix HUD deleting text contents in Writer

It will be available in 7.3.2.

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 12 Commit Notification 2022-02-18 14:02:22 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/b4bb43a896f5cffef69aba4082cee64d2be917d7

tdf#143817 Fix HUD deleting text contents in Writer

It will be available in 7.2.7.

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 13 Commit Notification 2022-02-23 11:53:32 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "libreoffice-7-3-1":

https://git.libreoffice.org/core/commit/60101a417ed9ef97a4bd982b8f9c6a26a38e2744

tdf#143817 Fix HUD deleting text contents in Writer

It will be available in 7.3.1.

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 14 Commit Notification 2022-03-02 13:41:09 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "libreoffice-7-2-6":

https://git.libreoffice.org/core/commit/adb43fd3629893481470b76680d76ed5f770327d

tdf#143817 Fix HUD deleting text contents in Writer

It will be available in 7.2.6.

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.