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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sun Jan 26 18:40:34 UTC 2020


 sw/source/core/text/frminf.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit ed3f2312b08e93daec613bf5fa8bbb07a56cefc7
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sun Jan 26 15:06:16 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sun Jan 26 19:39:48 2020 +0100

    Avoid explicit cast to smaller sal_uInt16 from larger long
    
    ...in what might be an attempt to avoid warnings about signed vs. unsigned
    comparisons.
    
    Change-Id: I43f3efdbd93d1bc9a51ea89ac4a728fc68205379
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87449
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx
index 3d6234e6e1de..ac25d9d1c1b4 100644
--- a/sw/source/core/text/frminf.cxx
+++ b/sw/source/core/text/frminf.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <o3tl/safeint.hxx>
+
 #include <frminf.hxx>
 #include "itrtxt.hxx"
 
@@ -78,7 +82,7 @@ bool SwTextFrameInfo::IsFilled( const sal_uInt8 nPercent ) const
     long nWidth = pFrame->getFramePrintArea().Width();
     nWidth *= nPercent;
     nWidth /= 100;
-    return sal_uInt16(nWidth) <= pLay->Width();
+    return o3tl::make_unsigned(nWidth) <= pLay->Width();
 }
 
 // Where does the text start (without whitespace)? (document global)


More information about the Libreoffice-commits mailing list