sw/inc/view.hxx | 3 +++ sw/source/uibase/uiview/viewport.cxx | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)
New commits: commit b05c184d52f72a1e8b8d34586eeffe55adcb1857 Author: Povilas Kanapickas <povi...@radix.lt> AuthorDate: Wed Dec 7 03:13:25 2022 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Dec 15 19:32:37 2022 +0000 sw: Extract SwView::{MIN,MAX}_ZOOM_PERCENT constants Change-Id: Id593752274121ad41dcdeb215be410a3577d890a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143752 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144226 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index c2d3772b7578..caaa808b6a24 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -268,6 +268,9 @@ class SW_DLLPUBLIC SwView: public SfxViewShell int m_nMaxOutlineLevelShown = 10; + static constexpr sal_uInt16 MAX_ZOOM_PERCENT = 600; + static constexpr sal_uInt16 MIN_ZOOM_PERCENT = 20; + // methods for searching // set search context SAL_DLLPRIVATE bool SearchAndWrap(bool bApi); diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 9b7bb9120f04..ff4c918c9619 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -1197,9 +1197,9 @@ bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) { sal_uInt16 nFact = m_pWrtShell->GetViewOptions()->GetZoom(); if( 0L > pWData->GetDelta() ) - nFact = std::max( static_cast<sal_uInt16>(20), basegfx::zoomtools::zoomOut( nFact )); + nFact = std::max(MIN_ZOOM_PERCENT, basegfx::zoomtools::zoomOut( nFact )); else - nFact = std::min( static_cast<sal_uInt16>(600), basegfx::zoomtools::zoomIn( nFact )); + nFact = std::min(MAX_ZOOM_PERCENT, basegfx::zoomtools::zoomIn( nFact )); SetZoom( SvxZoomType::PERCENT, nFact ); bOk = true;