ofz#6720 Divide-by-zero

Change-Id: I81d89a41437456535949e1cd214ec4e514c26494
Reviewed-on: https://gerrit.libreoffice.org/50733
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2018-03-04 15:34:15 +00:00
parent 7b7e0ff7b7
commit 09c311b0fb

View File

@@ -2834,15 +2834,19 @@ void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32
{ {
double fontSize = 0; double fontSize = 0;
font->second >>= fontSize; font->second >>= fontSize;
nEscapement = nIntValue * 100 / fontSize; if (fontSize != 0.0)
nEscapement = nIntValue * 100 / fontSize;
} }
// TODO if not direct formatting, check the style first, not directly the default char props. // TODO if not direct formatting, check the style first, not directly the default char props.
else if (aDefaultFont) else if (aDefaultFont)
{ {
double fHeight = 0; double fHeight = 0;
aDefaultFont->second >>= fHeight; aDefaultFont->second >>= fHeight;
// fHeight is in points, nIntValue is in half points, nEscapement is in percents. if (fHeight != 0.0)
nEscapement = nIntValue * 100 / fHeight / 2; {
// fHeight is in points, nIntValue is in half points, nEscapement is in percents.
nEscapement = nIntValue * 100 / fHeight / 2;
}
} }
else else
{ // TODO: Find out the font size. The 58/-58 values were here previous, but I have { // TODO: Find out the font size. The 58/-58 values were here previous, but I have