summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-02-07 15:04:27 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-02-07 16:04:17 +0100
commitfd66ee183f4ae61d0dff2e732c80edccb2bad362 (patch)
treed23ea1773bc019383a35be80eecd59fb8f323944 /svx
parentfc723fd872d5ffa52551f570b64c2b924d1cc97e (diff)
Keep nW non-negative here
...which happens when GetParent()->GetOutputSizePixel().Width() is zero (as seen, e.g., during JunitTest_forms_unoapi_2). It is assigned to sal_uInt16 nX further down, which then causes failure with Clang's -fsanitize=implicit-signed- integer-truncation. And when the parent size is apparently too small (zero) there is probably no value in operating with a value less than zero here---there won't be a reasonable layout of controls anyway. Change-Id: Ic1fa75f94a9a2878c60fca4cb03e4fbf6f9fda98 Reviewed-on: https://gerrit.libreoffice.org/67507 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/gridctrl.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index e97bfb8fcaf5..6ea74294722e 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -485,7 +485,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls()
nX = sal::static_int_cast< sal_uInt16 >(aButtonPos.X() + 1);
- nW -= GetSettings().GetStyleSettings().GetScrollBarSize();
+ nW = std::max(nW - GetSettings().GetStyleSettings().GetScrollBarSize(), 0L);
if (nX > nW)
{