From 4c29c7107ed45b777a63c4060340e03f54375391 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 30 May 2023 14:49:22 +0200 Subject: 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 --- sw/source/uibase/uiview/viewmdi.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sw/source') 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; -- cgit