summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-05-30 14:49:22 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-05-30 17:45:55 +0200
commit4c29c7107ed45b777a63c4060340e03f54375391 (patch)
treeee5b38f5a7657cf14eddb976badd46beb3d14bc2 /sw/source
parentd2c02a9aba3c05e4b3072596d2b3871b7fe67864 (diff)
sw: SwView::SetZoom_() shouldn't subtract page margins
In the PAGEWIDTH mode, this has the annoying habit of changing the zoom factor when moving the cursor between a page with a mirrored page style and a page with a non-mirrored page style. Change-Id: I0e4290432ebaa5012b10d896fc96ae53b39fa475 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152391 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/uiview/viewmdi.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx
index b00cb475ea34..f07c25e2dfc1 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -121,14 +121,15 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType,
const MapMode aTmpMap( MapUnit::MapTwip );
const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
- if( UseOnPage::Mirror == rDesc.GetUseOn() ) // mirrored pages
- {
- const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
- aPageSize.AdjustWidth(std::abs( rLeftLRSpace.GetLeft() - rLRSpace.GetLeft() ) );
- }
-
if( SvxZoomType::OPTIMAL == eZoomType )
{
+ // unclear if this is useful for OPTIMAL, or completely useless?
+ if( UseOnPage::Mirror == rDesc.GetUseOn() ) // mirrored pages
+ {
+ const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace();
+ aPageSize.AdjustWidth(std::abs( rLeftLRSpace.GetLeft() - rLRSpace.GetLeft() ) );
+ }
+
if (!pPostItMgr->HasNotes() || !pPostItMgr->ShowNotes())
aPageSize.AdjustWidth( -( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 ) );
lLeftMargin = rLRSpace.GetLeft() + DOCUMENTBORDER + nLeftOfst;