Kaydet (Commit) fd66ee18 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst fc723fd8
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment