sd/source/ui/view/drviews1.cxx | 12 ++++++++---- sd/source/ui/view/drviews2.cxx | 1 - sd/source/ui/view/outlnvs2.cxx | 2 -- sd/source/ui/view/outlnvsh.cxx | 2 ++ sd/source/ui/view/viewshe2.cxx | 1 + 5 files changed, 11 insertions(+), 7 deletions(-)
New commits: commit 11d3140b7f5f96d24eb9728c74ef2fd638a86b44 Author: Mohit Marathe <[email protected]> AuthorDate: Wed Jan 28 12:16:04 2026 +0530 Commit: Mohit Marathe <[email protected]> CommitDate: Thu Jan 29 14:54:45 2026 +0100 tdf#170324 sd: only trigger auto zoom change when switching to or from canvas page. Also, call RememberPageZoom from a more general place i.e. *ViewShell::SetZoom, so that page zoom is remembered when zoom is changed via any method. Signed-off-by: Mohit Marathe <[email protected]> Change-Id: Ib9a4efc6b641b1f52d263f4cc903ebc90630340b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198253 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit e2e70915c59c1540160c1608d964af0c760c3ee0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198292 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index fba9a9c8835e..e5a335efc6d9 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -266,6 +266,7 @@ void DrawViewShell::SetZoom( ::tools::Long nZoom ) GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); mpViewOverlayManager->onZoomChanged(); collectUIInformation(OUString::number(nZoom)); + RememberPageZoom(nZoom); } /** @@ -1145,11 +1146,14 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus) } else { - const sal_uInt16 nZoom = GetPageZoom(); - if (nZoom) + if (bChangeZoom && bAllowChangeFocus) { - const SvxZoomItem aZoomItem(SvxZoomType::PERCENT, nZoom, SID_ATTR_ZOOM); - GetViewFrame()->GetDispatcher()->ExecuteList(SID_ATTR_ZOOM, SfxCallMode::SLOT, {&aZoomItem}); + const sal_uInt16 nZoom = GetPageZoom(); + if (nZoom) + { + const SvxZoomItem aZoomItem(SvxZoomType::PERCENT, nZoom, SID_ATTR_ZOOM); + GetViewFrame()->GetDispatcher()->ExecuteList(SID_ATTR_ZOOM, SfxCallMode::SLOT, {&aZoomItem}); + } } } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 5822d23e18c6..b65b18f172d0 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1655,7 +1655,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { sal_uInt16 nZoom = pArgs->Get( SID_ATTR_ZOOM ).GetValue(); SetZoom( static_cast<::tools::Long>( nZoom ) ); - RememberPageZoom(nZoom); } break; diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index 7055d2c19b2a..443ba8a8f773 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -88,8 +88,6 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) SetZoom( static_cast<::tools::Long>( pArgs->Get( SID_ATTR_ZOOM ).GetValue()) ); Invalidate( SID_ATTR_ZOOM ); Invalidate( SID_ATTR_ZOOMSLIDER ); - sal_uInt16 nZoom = aZoom.GetValue(); - RememberPageZoom(nZoom); } break; diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index ea1347ccc42b..21b60301c2d0 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1124,6 +1124,8 @@ void OutlineViewShell::SetZoom(::tools::Long nZoom) GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM ); GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); + + RememberPageZoom(nZoom); } /** diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 1d7b28dd7132..2fef81b4f7d3 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -404,6 +404,7 @@ void ViewShell::SetZoom(::tools::Long nZoom) } UpdateScrollBars(); + RememberPageZoom(nZoom); } ::tools::Long ViewShell::GetZoom() const
