sw/source/uibase/uiview/viewmdi.cxx |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit e12ebcfabec18430e2fd931842a7c0a689820bd0
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue May 30 14:49:22 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed May 31 11:40:51 2023 +0200

    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.st...@allotropia.de>
    (cherry picked from commit 0c1aa15d05cc52e3f2b34d0ccc9fc47bcf2f379b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152329
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 10c79e145477e7a247c491756e5cd8ae0317ddaa)

diff --git a/sw/source/uibase/uiview/viewmdi.cxx 
b/sw/source/uibase/uiview/viewmdi.cxx
index 4fd706e84667..5fb06156c1a2 100644
--- a/sw/source/uibase/uiview/viewmdi.cxx
+++ b/sw/source/uibase/uiview/viewmdi.cxx
@@ -127,14 +127,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;

Reply via email to