Bug 147041 - Double-clicking an element in Navigator shows it in the middle of the document view instead of at the top
Summary: Double-clicking an element in Navigator shows it in the middle of the documen...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: low trivial
Assignee: Jim Raykowski
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2022-01-28 13:29 UTC by Buovjaga
Modified: 2022-01-31 07:14 UTC (History)
1 user (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 Buovjaga 2022-01-28 13:29:33 UTC
I noticed this post and decided to investigate: https://www.reddit.com/r/libreoffice/comments/sdycms/72_changed_where_i_land_when_using_navigation/

1. Add heading
2. Double-click it in the Navigator

The view scrolls, so the heading is in the middle.

A bibisect with linux-64-7.2 points to https://git.libreoffice.org/core/commit/1df2581cfffc87386c6de7614793b2d664244e5a
tdf#137838 SW: Add ability to create a hyperlink to a drawing object

Adding Cc: to Jim Raykowski

Was the change intentional or accidental?
Comment 1 Jim Raykowski 2022-01-29 02:47:06 UTC
Hi Buovjaga, 

I was not able to repro following the STR but looking at the bibisected patch I see what happened:

   -// force scroll to cursor position when navigating to inactive document
   -if(!bSel)
   +// assure visible view area is at cursor position
   + if (!m_pActiveShell->IsCursorVisible() && !m_pActiveShell->IsFrameSelected()          && !m_pActiveShell->IsObjSelected())

The GotoOutline function brings the heading into view so it doesn't get force scroll to the top.

Easy enough to revert to previous behavior:

https://gerrit.libreoffice.org/c/core/+/129129
Comment 2 Buovjaga 2022-01-29 10:12:39 UTC
Thanks for the quick response. I confirm the patch puts back the old behaviour.
Comment 3 Commit Notification 2022-01-29 20:50:52 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#147041 Always show navigated heading at top of visible view area

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 4 Buovjaga 2022-01-30 07:05:28 UTC
Should we cherry pick it to 7-3 so it gets into 7.3.1?
Comment 5 Jim Raykowski 2022-01-31 00:53:42 UTC
(In reply to Buovjaga from comment #4)
> Should we cherry pick it to 7-3 so it gets into 7.3.1?

Sure, I'll try. This is the first time I've cherry picked using gerrit. I've did it locally for fun.
https://gerrit.libreoffice.org/c/core/+/129080
Comment 6 Commit Notification 2022-01-31 02:48:13 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

tdf#147041 Always show navigated heading at top of visible view area

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.