summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-01-23 09:34:21 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-01-23 11:12:29 +0100
commit1f0ef4a86cf7ff83bba26f141408d9ccb296fb2a (patch)
tree4bf9b29c650d1719ed53191a941b94dda8f2577e /vcl
parent53cd5d1f50d3da4efe0938aa340f6a57a0b8501d (diff)
Avoid explicit casts to smaller sal_uInt16 from larger long resp. int
...in what might be attempts to avoid warnings about signed vs. unsigned comparisons Change-Id: I9d6b9f1fce6de829103c5c35d5d606ce0398807a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87241 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/splitwin.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 4ae7f4851fda..f1f56776cc5d 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -19,6 +19,7 @@
#include <string.h>
+#include <o3tl/safeint.hxx>
#include <sal/log.hxx>
#include <vcl/event.hxx>
@@ -491,7 +492,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
}
// do not compensate rounding errors here
- if ( (nAbsItems < static_cast<sal_uInt16>(std::abs( nSizeDelta ))) && nSizeWinSize )
+ if ( (nAbsItems < o3tl::make_unsigned(std::abs( nSizeDelta ))) && nSizeWinSize )
{
long nNewSizeWinSize = 0;
@@ -1678,7 +1679,7 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt )
bool bPropSmaller;
mnMouseModifier = rMEvt.GetModifier();
- bPropSmaller = (mnMouseModifier & KEY_SHIFT) && (static_cast<sal_uInt16>(mnSplitPos+1) < mpSplitSet->mvItems.size());
+ bPropSmaller = (mnMouseModifier & KEY_SHIFT) && (o3tl::make_unsigned(mnSplitPos+1) < mpSplitSet->mvItems.size());
// here we can set the maximum size
StartSplit();