sw/inc/view.hxx                      |    3 +++
 sw/source/uibase/uiview/viewport.cxx |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 0280538af13617145987663ad6407190939794f2
Author:     Povilas Kanapickas <povi...@radix.lt>
AuthorDate: Wed Dec 7 03:13:25 2022 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Dec 14 13:41:34 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>

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;

Reply via email to