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,6 +2834,7 @@ void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32
{
double fontSize = 0;
font->second >>= fontSize;
if (fontSize != 0.0)
nEscapement = nIntValue * 100 / fontSize;
}
// TODO if not direct formatting, check the style first, not directly the default char props.
@@ -2841,9 +2842,12 @@ void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32
{
double fHeight = 0;
aDefaultFont->second >>= fHeight;
if (fHeight != 0.0)
{
// fHeight is in points, nIntValue is in half points, nEscapement is in percents.
nEscapement = nIntValue * 100 / fHeight / 2;
}
}
else
{ // TODO: Find out the font size. The 58/-58 values were here previous, but I have
// no idea what they are (they are probably some random guess that did fit whatever