Kaydet (Commit) 78e670b3 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1078538 Division or modulo by zero

Change-Id: I0ae8d51a569c2a63f5fb390e66fdbde4a8e8b5d5
üst 2149e924
......@@ -1455,9 +1455,14 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv
}
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;
double nW = nAbsTabWidth - nMin;
double nD = (nMax==nMin ? 1 : nMax-nMin);
sal_uInt16 nAbs = 0, nRel = 0;
......
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