Bug 99928 - VIEWING Zooming during Print Preview on Writer should be centred on present view point
Summary: VIEWING Zooming during Print Preview on Writer should be centred on present v...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6 all versions
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, regression
Depends on:
Blocks: Zoom
  Show dependency treegraph
 
Reported: 2016-05-18 09:21 UTC by RGB
Modified: 2022-08-18 00:38 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Quick example to follow the steps comented on the report (17.11 KB, application/vnd.oasis.opendocument.text)
2016-05-18 09:21 UTC, RGB
Details
99928_patch.diff: my hack that works except when horizontal bar is added (1.93 KB, patch)
2021-07-13 15:39 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2016-05-18 09:21:20 UTC
Created attachment 125141 [details]
Quick example to follow the steps comented on the report

1- Open the attached document and activate the page preview: the full page is presented

2- Zoom it to, say, 200% and centre the view on the →focus on← bold text

3- Zoom even more, like up to 400%

Result: the zoomed part of the page is the top left one, not the part chosen on the first zoom.

This is quite uncomfortable on many situations. For example, let's say I inserted a small image anchored "as character" and I want to see if it is well aligned with the paragraph baseline. If I start to zoom in on page preview the view is always centred on the top-left of the page so each time I need to increase the zoom I also need to scroll the page to find again the particular point of interest, something that becomes more and more difficult with bigger zooming factors.

Proposal: on page preview, the zoom should always be centred on the current viewpoint.
Comment 1 Cor Nouws 2016-05-18 10:52:14 UTC
Hi,

thanks for filing I confirm this on a recent master build.
LO 3.3.0 behaves as you describe. So got wrecked somewhere in between.

Ciao - Cor
Comment 2 raal 2016-05-19 07:14:21 UTC
repro  Version: 4.5.0.0.alpha0+
Comment 3 raal 2016-05-25 20:57:19 UTC
 git bisect log
# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# bad: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect bad e02439a3d6297a1f5334fa558ddec5ef4212c574
# bad: [8f4aeaad2f65d656328a451154142bb82efa4327] source-hash-1885266f274575327cdeee9852945a3e91f32f15
git bisect bad 8f4aeaad2f65d656328a451154142bb82efa4327
# good: [369369915d3582924b3d01c9b01167268ed38f3b] source-hash-45295f3cdceb4c289553791071b5d7f4962d2ec4
git bisect good 369369915d3582924b3d01c9b01167268ed38f3b
# bad: [6fce03a944bf50e90cd31e2d559fe8705ccc993e] source-hash-47e4a33a6405eb1b5186027f55bd9cb99b0c1fe7
git bisect bad 6fce03a944bf50e90cd31e2d559fe8705ccc993e
# bad: [8a39227e344637eb7154a10ac825d211e64d584c] source-hash-f5080ebb7022c9f5d7d7fdca4fe9d19f9bb8cabf
git bisect bad 8a39227e344637eb7154a10ac825d211e64d584c
# bad: [e8bc60acad752e284db73fc4d8ad383ac055361c] source-hash-7e6e16ba6de2d3ef2b130d1ad5ffeabfdb37918e
git bisect bad e8bc60acad752e284db73fc4d8ad383ac055361c
# bad: [19b8950109d519c0dba847f94d5d166044c1db15] source-hash-ff9cca69744b54ca84d98476a9a969d1aa0ff2d3
git bisect bad 19b8950109d519c0dba847f94d5d166044c1db15
# good: [f23b0ac1f569b0e043ebc0d0fe08ec76ea23d656] source-hash-552ba413bc95b1a14638558d9436141825100c52
git bisect good f23b0ac1f569b0e043ebc0d0fe08ec76ea23d656
# bad: [f3986117cf91f1976749922e435915354389c4f1] source-hash-eab7e131ecebe4cdefcdcb1ad176bbdce83cb467
git bisect bad f3986117cf91f1976749922e435915354389c4f1
# good: [cef0750df9186e2523a1a2d1ddb4c1ddbb85c19d] source-hash-18c661f715a0b6850d30b374e5556dc14a377d2b
git bisect good cef0750df9186e2523a1a2d1ddb4c1ddbb85c19d
# first bad commit: [f3986117cf91f1976749922e435915354389c4f1] source-hash-eab7e131ecebe4cdefcdcb1ad176bbdce83cb467

http://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=18c661f715a0b6850d30b374e5556dc14a377d2b..eab7e131ecebe4cdefcdcb1ad176bbdce83cb467

Commits with "preview" in name. Noel, can this commits be relevant? Thanks
2012-04-03	Hori/Vert scrollbars in calc preview should be shown only when necessary	Noel Power	commit f194d18dfeceff104f9c5e500ea4dd94fa1b5b06 
2012-04-03	Revert "Hori scroll fix in Writer and Calc Print Preview" & add new patch	Noel Power commit d7b06ba7ec2c988e80c8ef14e2d9bfc2c29e2d24
Comment 4 Björn Michaelsen 2016-08-12 18:54:36 UTC
as per comment this was introduced with libreoffice 3.6 latest.
Comment 5 QA Administrators 2017-09-01 11:15:44 UTC Comment hidden (obsolete)
Comment 6 RGB 2017-09-01 12:37:37 UTC Comment hidden (obsolete)
Comment 7 Xisco Faulí 2017-09-13 16:52:45 UTC
Same range of commits as in bug 99332. Adding to see also
Comment 8 QA Administrators 2018-09-14 02:47:16 UTC Comment hidden (obsolete)
Comment 9 RGB 2018-09-14 07:31:08 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2019-09-15 02:47:31 UTC Comment hidden (obsolete)
Comment 11 RGB 2019-09-15 15:06:58 UTC
Problem still present in 6.3.1.2
Comment 12 Justin L 2021-07-13 15:38:27 UTC
(In reply to raal from comment #3)
> 2012-04-03  Revert "Hori scroll fix in Writer and Calc Print Preview" & add
> new patch   Noel Power commit d7b06ba7ec2c988e80c8ef14e2d9bfc2c29e2d24
https://cgit.freedesktop.org/libreoffice/core/commit/?id=d7b06ba7ec2c988e80c8ef14e2d9bfc2c29e2d24

Yup, this is the one.  Particularly calls to ShowVScrollbar and
-            pHScrollbar->Show( sal_True );
+            ShowHScrollbar( sal_True );

which start some recursive calls because it calls InvalidateBorder(), loses the rDocRect, and get everything reset to 0,0 perhaps because !m_nAdjustPosPixelLock.

Unfortunately, it isn't possible to just revert to Scrollbar->Show() any more. This is too convoluted for a mere mortal.
Comment 13 Justin L 2021-07-13 15:39:36 UTC
Created attachment 173532 [details]
99928_patch.diff: my hack that works except when horizontal bar is added
Comment 14 Justin L 2022-08-18 00:38:26 UTC
repro 7.5+
My question is, why would you go into print preview mode to zoom? Why not just zoom normally?