Kaydet (Commit) 6fa813da authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1078538 Division or modulo by zero

Change-Id: I4f8f66689b46f594664c44da4e892983f38ad32e
üst c4e53fad
......@@ -1329,9 +1329,14 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
// Only use the relative widths' fraction, that is used for the
// absolute width.
sal_uLong nAbsTabWidthL = nAbsTabWidth;
nRelTabWidth =
( nRelAvail ? (sal_uInt16)((nAbsTabWidthL * nRelAvail) / nAbsAvail)
: nAbsTabWidth );
if (nRelAvail)
{
if (nAbsAvail == 0)
throw o3tl::divide_by_zero();
nRelTabWidth = (sal_uInt16)((nAbsTabWidthL * nRelAvail) / nAbsAvail);
}
else
nRelTabWidth = nAbsTabWidth;
// Are there columns width a percentage setting and some without one?
sal_uLong nFixMax = nMax;
......
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