Bug 115666 - “Navigate By” Function does not Work if Cursor is Positioned in Comment
Summary: “Navigate By” Function does not Work if Cursor is Positioned in Comment
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.1.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Jim Raykowski
URL:
Whiteboard: target:6.1.0
Keywords:
: 115681 (view as bug list)
Depends on:
Blocks: Navigate-By
  Show dependency treegraph
 
Reported: 2018-02-12 22:49 UTC by Harald Koester
Modified: 2018-11-04 16:59 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koester 2018-02-12 22:49:34 UTC
In order to reproduce:

[1] Create a new text document and insert 3 simple tables with some empty lines between them..
[2] Insert a comment after first table. 
[3] Position the cursor inside the comment.
[4] Display Find toolbar and select Table in “Navigate By” drop-down menu.
[5] Click arrow keys in order to find the previous or next table. Nothing happens. The cursor is still in the comment. Expected: Cursor in tables.

This bug also occurs if you use bookmarks instead of tables. I did not check the other object types.
Comment 1 Kevin Suo 2018-02-13 02:41:40 UTC
Reproduced, but I do not think this is a bug.

When cursor is in the comment, the comment area is active. Since there is no table inside the comment, noting is found, that is why there is no reaction when you click the up and down arrow button.

If you put the cursor back to the text area, then find the tables with up and down arrow buttons work perfect.

Version: 6.0.0.3 (x64)
Build ID:64a0f66915f38c6217de274f0aa8e15618924765
CPU 线程:4; 操作系统:Windows 10.0; UI 渲染:默认; 
区域语言:zh-CN (zh_CN); Calc: group

I mark it as NEW, and added keyword needsUXEval.
Comment 2 Kevin Suo 2018-02-13 02:43:44 UTC
Note that this happens not only for tables, but also for any other objects such as shapes, images etc.
Comment 3 BLaACkRose 2018-02-13 07:00:35 UTC
The table is not selected therefore noting is assigned
Comment 4 Heiko Tietze 2018-02-13 10:28:48 UTC
Nothing to add. Same happens when you enter an object such as text in a shape. 

That you expect the behavior from the F&R toolbar is another question and results from the mix-up of functions around find with navigational operations.
Comment 5 Harald Koester 2018-02-19 15:55:30 UTC
Sorry I don't agree. I checked the Navigate By function for some other object types while the cursor is positioned in the comment. For some object types (Graphics, Drawing) the Navigate By function still works and for other types (Table, Bookmark) it does not work. For me this is not consistent, either it should work for all object types or for no types. And from a users view I would expect, that the Navigate By function also and always works if the cursor is positioned in a comment.
Comment 6 Heiko Tietze 2018-02-19 18:22:43 UTC
(In reply to Harald Koester from comment #5)
> ... For some object
> types (Graphics, Drawing) the Navigate By function still works and for other
> types (Table, Bookmark) it does not work.

It will not work after you "enter" the object, i.e. switch to the edit mode.
Comment 7 Harald Koester 2018-02-20 12:47:07 UTC
(In reply to Heiko Tietze from comment #6)
> (In reply to Harald Koester from comment #5)
> > ... For some object
> > types (Graphics, Drawing) the Navigate By function still works and for other
> > types (Table, Bookmark) it does not work.
> 
> It will not work after you "enter" the object, i.e. switch to the edit mode.

I do not really understand what you mean with entering an object. E.g. is this the case if the cursor is inside a comment? In this case as I said, the Navigate By function *works* with some object types (Graphics, Drawing) and does not work with other object types (Table, Bookmark).

In this case the Navigate By function works as expected.
[1] Create a new text document and insert 2 images.
[2] Insert a comment between the 2 images. The cursor is inside the comment.
[3] Display Find toolbar and select Graphics in the Navigate By drop-down menu.
[4] Click "Next graphic" (down arrow). The second image is selected as expected. The cursor is still in the comment.
[5] Click "Previous graphic" (up arrow). The first image is selected as expected.
Comment 8 Jim Raykowski 2018-02-26 00:50:02 UTC
Hi All, 

This behavior can be changed in the move navigation code by performing the same function as a keyboard Escape does while in a Comment and then doing the Navigate By.
Comment 9 Thomas Lendo 2018-02-28 00:38:57 UTC
I'm with Harald in comment 5 that it should work for all object types or for nothing when the cursor is in a comment or in 'normal edit mode' (not during editing a shape, chart, etc.).
Comment 10 Heiko Tietze 2018-02-28 19:58:21 UTC
(In reply to Thomas Lendo from comment #9)
> I'm with Harald in comment 5 that it should work for all object types...
Guess you closed the ticket unintentionally.

After discussing the topic in the design meeting the recommendation is to implement the feature with low priority (ie. if effort is limited). Users should be aware that a search is context dependent. But OTOH it works on most places and wont hurt to include the document text when searching in comments. 

Objects in edit mode are out-of-scope, so the change affects only comments.
Comment 11 Jim Raykowski 2018-03-01 05:19:10 UTC
I can't believe I just committed a patch again without 

1. asking if anyone is working on this patch
2. take (assign) patch to self

I'm going to get the next one right.  

Here is a link to a patch for review
https://gerrit.libreoffice.org/#/c/50551/

Much respect and thanks to all who make this project great and fun!
Comment 12 Commit Notification 2018-03-01 07:36:47 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#115666 Behavior change of Navigate By when in Comment

It will be available in 6.1.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 13 Heiko Tietze 2018-03-01 10:32:03 UTC
Works well, thanks for the patch. 

And I was totally wrong with the scope; the issue is only about right-most up/down buttons that jump from table to table but didn't when in a comment. The request was not to in- or exclude comments or other areas from the search.
Comment 14 Buovjaga 2018-03-06 15:14:24 UTC
*** Bug 115681 has been marked as a duplicate of this bug. ***
Comment 15 Harald Koester 2018-10-24 13:31:59 UTC
Verified with 6.1.2. Thus bug closed.