summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-01-26 15:06:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-01-26 19:39:48 +0100
commited3f2312b08e93daec613bf5fa8bbb07a56cefc7 (patch)
tree27766553fd190524ea0607338c6e4e32453b0feb /sw
parent32922b3f1fc47415b40a701345a76a33e2d69a64 (diff)
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@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/frminf.cxx6
1 files changed, 5 insertions, 1 deletions
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)