[Libreoffice-commits] core.git: sc/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 13 21:19:16 UTC 2020


 sc/source/ui/view/tabvwsh3.cxx |    8 ++++----
 sc/source/ui/view/tabvwsha.cxx |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit bbbcd382af9e60bd1c23205804740b8dae9272c3
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Fri Nov 13 19:49:04 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Nov 13 22:18:26 2020 +0100

    loplugin:toolslong
    
    following:
    https://cgit.freedesktop.org/libreoffice/core/commit/?id=95b27dd2e5b5bdcb39962f72882dcdf406bcb393
    author  Jim Raykowski <raykowj at gmail.com>       2020-10-11 16:15:47 -0800
    committer       Jim Raykowski <raykowj at gmail.com>       2020-11-13 17:53:20 +0100
    commit  95b27dd2e5b5bdcb39962f72882dcdf406bcb393 (patch)
    tree    84c49a7daadf1ce908a9f5608d40494af164917d
    parent  d40f2d02df26e216f367b5da3f9546b73f250469 (diff)
    tdf#45705 rework zoom in and zoom out UI commands in Calc
    Similar to commit 2cddaa6e199ed8bb6185b7825791199f9da4a670 done for
    Writer view shell, this patch makes zoom in and zoom out commands
    functional for Calc view shell in addition to the preview shell.
    
    Change-Id: I1128d0990829015e21e352c2084a44849a37a7f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105806
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index c2f496b3e2cd..72e6a72707ab 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -706,12 +706,12 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                     //  and can't be changed directly
 
                     const Fraction& rOldY = GetViewData().GetZoomY();
-                    long nOld = static_cast<long>(rOldY * 100);
-                    long nNew;
+                    tools::Long nOld = tools::Long(rOldY * 100);
+                    tools::Long nNew;
                     if (SID_ZOOM_OUT == nSlot)
-                        nNew = std::max(long(MINZOOM), basegfx::zoomtools::zoomOut(nOld));
+                        nNew = std::max(tools::Long(MINZOOM), basegfx::zoomtools::zoomOut(nOld));
                     else
-                        nNew = std::min(long(MAXZOOM), basegfx::zoomtools::zoomIn(nOld));
+                        nNew = std::min(tools::Long(MAXZOOM), basegfx::zoomtools::zoomIn(nOld));
                     if ( nNew != nOld)
                     {
                         bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom();
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 8b6674dca3c9..4a6062fddff5 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -294,16 +294,16 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
             case SID_ZOOM_IN:
                 {
                     const Fraction& rZoomY = GetViewData().GetZoomY();
-                    long nZoom = static_cast<long>(rZoomY * 100);
-                    if (nZoom >= long(MAXZOOM))
+                    tools::Long nZoom = tools::Long(rZoomY * 100);
+                    if (nZoom >= tools::Long(MAXZOOM))
                         rSet.DisableItem(nWhich);
                 }
                 break;
             case SID_ZOOM_OUT:
                 {
                     const Fraction& rZoomY = GetViewData().GetZoomY();
-                    long nZoom = static_cast<long>(rZoomY * 100);
-                    if (nZoom <= long(MINZOOM))
+                    tools::Long nZoom = tools::Long(rZoomY * 100);
+                    if (nZoom <= tools::Long(MINZOOM))
                         rSet.DisableItem(nWhich);
                 }
                 break;


More information about the Libreoffice-commits mailing list