Bug 101936

Summary: Inserting comments makes commented text unsearchable
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: WriterAssignee: Justin L <jluth>
Status: VERIFIED FIXED    
Severity: normal CC: dgp-mail, ilmari.lauhakangas, jluth, philipz85, thomas.lendo, xiscofauli
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=74177
https://bugs.documentfoundation.org/show_bug.cgi?id=118673
https://bugs.documentfoundation.org/show_bug.cgi?id=118734
Whiteboard: target:6.0.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 102847, 106179    
Attachments: sample
commentSearch.odt: 3 testing scenarios

Description Mike Kaganski 2016-09-06 15:07:35 UTC
If a comment is inserted into a word (not applied to the whole word, just to its part or just put between characters), the word is no longer available for search.

To reproduce:
1. Create a blank text document.
2. Type 123 456 789.
2a. Try to search the document (Ctfl+F) for text "456". See the search succeeds.
3. Put caret between 4 and 5.
4. Insert a comment (Ctrl+Alt+C), with some text.
5. Now try to search the document (Ctfl+F) for text "456".

Expected result: the text should be found at step 5.
Actual result: the text is not found.

That is related to the problem reported in bug 74177. Unlike Calc, in Writer the comment is like a special kind of "character" inserted into the text.

Already reproducible with OOo 3.3.0.
Comment 1 Buovjaga 2016-09-28 19:20:05 UTC
Repro.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha0+
Build ID: 7cf444454c0c27e2f6d764164ea880b87163f45a
CPU Threads: 8; OS Version: Linux 4.7; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on September 27th 2016
Comment 2 Mike Kaganski 2017-06-26 10:28:40 UTC
Justin, this looks a bit similar to the problem you solved recently (bug 74177), so I figured if you could take a look at this while your memory is fresh?
Comment 3 Yousuf Philips (jay) (retired) 2017-06-26 12:55:02 UTC
Created attachment 134290 [details]
sample

Did some testing and the issue seems to be that the comment's end cursor position is messing up with searching. Also the issue happens when comments are visible or hidden.

Steps:
1. Open attachment
2. Search for 'ABC DEF' and it works fine
3. Search for 'ABC DEF ' and it doesnt work
Comment 4 Justin L 2017-06-28 16:07:14 UTC
Created attachment 134355 [details]
commentSearch.odt: 3 testing scenarios

potential fix at https://gerrit.libreoffice.org/#/c/39361/
Comment 5 Commit Notification 2017-09-01 17:24:58 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=16db6243768ccde2cf0f78da0834fe4ff14f5c3c

tdf#101936 sw: ignore comment anchors during search

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Dieter 2019-09-24 18:23:04 UTC
VERIFIED with

Version: 6.3.2.2 (x64)
Build-ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded