Issue 128461 - Zoom in Page Preview - negative values are treated as 600 (max factor)
Summary: Zoom in Page Preview - negative values are treated as 600 (max factor)
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: 4.1.10
Hardware: PC All
: P5 (lowest) Trivial (vote)
Target Milestone: 4.1.12
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-15 17:48 UTC by Czesław Wolański
Modified: 2022-03-22 19:30 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.11
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Czesław Wolański 2021-06-15 17:48:48 UTC
1. In Writer document switch to Page Preview
   (choose menu 'File - Page Preview' or
    click the "Page Preview" icon on the Standard bar)
2. Enter a negative value in the combo box "Preview Zoom"
   on the Page Preview bar.

Result:
the zoom level of the page preview is set to 600 %
Comment 1 Matthias Seidel 2021-06-15 18:03:45 UTC
Confirmed on Ubuntu 16.04 with AOO 4.1.10.

On the other hand A negative zoom value entered via "View - Zoom" and then "Variable" results in a zoom factor of 20%.

I think this should be the preferred way also for "Page Preview".
Comment 2 Czesław Wolański 2021-06-15 18:17:54 UTC
> I think this should be the preferred way also for "Page Preview".

Yes. It works that way in the combo box for zero and positive values less than 20.

_Possible_ code pointer - the source file /main/sw/source/ui/ribbar/workctrl.cxx
with its function SwZoomBox_Impl::Select()


814  void    SwZoomBox_Impl::Select()
815  {
816      if ( !IsTravelSelect() )
817      {
818          String sEntry(GetText());
819          sEntry.EraseAllChars( '%' );
820          sal_uInt16 nZoom = (sal_uInt16)sEntry.ToInt32();
821          if(nZoom < MINZOOM)
822              nZoom = MINZOOM;
823          if(nZoom > MAXZOOM)
824              nZoom = MAXZOOM;


Line 820 seems to be a culprit.
For anyone with a good command of C++ that should be an easy fix.
Comment 3 Arrigo Marchiori 2022-03-22 18:25:26 UTC
Fixed with commit 1dfc6c9463fbb9b844e2b5cbe65eeb832bc1a977

Thank you!