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

See Also:
Crash report or crash signature:

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

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

Arch Linux 64-bit, KDE Plasma 5
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]

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.

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":


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:

Affected users are encouraged to test the fix and report feedback.