[Libreoffice-commits] core.git: vcl/osx

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 28 14:08:34 UTC 2020


 vcl/osx/salframe.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit c43d6d6a3ac1a8a93b3e2ba2f549a7135848487f
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jan 28 13:10:14 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Jan 28 15:07:52 2020 +0100

    loplugin:unsignedcompare (macOS)
    
    Change-Id: Idaba1b3731ee551ca747b6b8eb6bf49e33fae415
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87604
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index ce5ada142911..dc012aa1d07b 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -22,6 +22,7 @@
 #include <comphelper/fileurl.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
+#include <o3tl/safeint.hxx>
 #include <osl/diagnose.h>
 
 #include <osl/file.h>
@@ -576,17 +577,17 @@ SalEvent AquaSalFrame::PreparePosSize(long nX, long nY, long nWidth, long nHeigh
         if (nFlags & SAL_FRAME_POSSIZE_WIDTH)
         {
             maGeometry.nWidth = nWidth;
-            if (mnMaxWidth > 0 && maGeometry.nWidth > static_cast<unsigned int>(mnMaxWidth))
+            if (mnMaxWidth > 0 && maGeometry.nWidth > o3tl::make_unsigned(mnMaxWidth))
                 maGeometry.nWidth = mnMaxWidth;
-            if (mnMinWidth > 0 && maGeometry.nWidth < static_cast<unsigned int>(mnMinWidth))
+            if (mnMinWidth > 0 && maGeometry.nWidth < o3tl::make_unsigned(mnMinWidth))
                 maGeometry.nWidth = mnMinWidth;
         }
         if (nFlags & SAL_FRAME_POSSIZE_HEIGHT)
         {
             maGeometry.nHeight = nHeight;
-            if (mnMaxHeight > 0 && maGeometry.nHeight > static_cast<unsigned int>(mnMaxHeight))
+            if (mnMaxHeight > 0 && maGeometry.nHeight > o3tl::make_unsigned(mnMaxHeight))
                 maGeometry.nHeight = mnMaxHeight;
-            if (mnMinHeight > 0 && maGeometry.nHeight < static_cast<unsigned int>(mnMinHeight))
+            if (mnMinHeight > 0 && maGeometry.nHeight < o3tl::make_unsigned(mnMinHeight))
                 maGeometry.nHeight = mnMinHeight;
         }
         if (nEvent != SalEvent::NONE)
@@ -783,7 +784,7 @@ void AquaSalFrame::doShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
         NSArray* pScreens = [NSScreen screens];
         if( pScreens )
         {
-            if( nDisplay >= 0 && static_cast<unsigned int>(nDisplay) < [pScreens count] )
+            if( nDisplay >= 0 && o3tl::make_unsigned(nDisplay) < [pScreens count] )
                 pScreen = [pScreens objectAtIndex: nDisplay];
             else
             {


More information about the Libreoffice-commits mailing list