[Libreoffice-commits] core.git: svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Feb 7 15:04:47 UTC 2019
svx/source/fmcomp/gridctrl.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit fd66ee183f4ae61d0dff2e732c80edccb2bad362
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Feb 7 15:04:27 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Feb 7 16:04:17 2019 +0100
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 at redhat.com>
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)
{
More information about the Libreoffice-commits
mailing list