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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Jan 23 13:09:11 UTC 2020


 vcl/headless/svpframe.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 48f32d77f914fb880fc023365c4e2910e741a7b9
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Jan 23 11:04:56 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jan 23 14:08:38 2020 +0100

    Avoid explicit casts to smaller unsigned int from larger long
    
    ...in what might be attempts to avoid warnings about signed vs. unsigned
    comparisons.  (The mismatch had been there ever since
    b6801926b515be4cfb10ca7e3322939f0f97426b "INTEGRATION: CWS mergesvp: #i78931#
    contribute svp sources".)
    
    Change-Id: Ibf7e8616740024dd02c4c2886785fb8c9d9cadde
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87251
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 20876ef2ff0a..0f6da8d2872f 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <comphelper/lok.hxx>
+#include <o3tl/safeint.hxx>
 #include <vcl/syswin.hxx>
 #include <sal/log.hxx>
 
@@ -237,17 +238,17 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
     if( (nFlags & SAL_FRAME_POSSIZE_WIDTH) != 0 )
     {
         maGeometry.nWidth = nWidth;
-        if( m_nMaxWidth > 0 && maGeometry.nWidth > static_cast<unsigned int>(m_nMaxWidth) )
+        if( m_nMaxWidth > 0 && maGeometry.nWidth > o3tl::make_unsigned(m_nMaxWidth) )
             maGeometry.nWidth = m_nMaxWidth;
-        if( m_nMinWidth > 0 && maGeometry.nWidth < static_cast<unsigned int>(m_nMinWidth) )
+        if( m_nMinWidth > 0 && maGeometry.nWidth < o3tl::make_unsigned(m_nMinWidth) )
             maGeometry.nWidth = m_nMinWidth;
     }
     if( (nFlags & SAL_FRAME_POSSIZE_HEIGHT) != 0 )
     {
         maGeometry.nHeight = nHeight;
-        if( m_nMaxHeight > 0 && maGeometry.nHeight > static_cast<unsigned int>(m_nMaxHeight) )
+        if( m_nMaxHeight > 0 && maGeometry.nHeight > o3tl::make_unsigned(m_nMaxHeight) )
             maGeometry.nHeight = m_nMaxHeight;
-        if( m_nMinHeight > 0 && maGeometry.nHeight < static_cast<unsigned int>(m_nMinHeight) )
+        if( m_nMinHeight > 0 && maGeometry.nHeight < o3tl::make_unsigned(m_nMinHeight) )
             maGeometry.nHeight = m_nMinHeight;
     }
 #ifndef IOS


More information about the Libreoffice-commits mailing list