Bug 101936 - Inserting comments makes commented text unsearchable
Summary: Inserting comments makes commented text unsearchable
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.0.0
Keywords:
Depends on:
Blocks: Find-Search Writer-Comments
  Show dependency treegraph
 
Reported: 2016-09-06 15:07 UTC by Mike Kaganski
Modified: 2019-09-24 18:23 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
sample (8.67 KB, application/vnd.oasis.opendocument.text)
2017-06-26 12:55 UTC, Yousuf Philips (jay) (retired)
Details
commentSearch.odt: 3 testing scenarios (11.52 KB, application/vnd.oasis.opendocument.text)
2017-06-28 16:07 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
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