diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-02-07 15:04:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-02-07 16:04:17 +0100 |
commit | fd66ee183f4ae61d0dff2e732c80edccb2bad362 (patch) | |
tree | d23ea1773bc019383a35be80eecd59fb8f323944 /svx | |
parent | fc723fd872d5ffa52551f570b64c2b924d1cc97e (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.cxx | 2 |
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) { |