summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-04 15:34:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-03-04 20:42:15 +0100
commit09c311b0fb4dbed5220ca50f133687ebfea24646 (patch)
tree3291d63965ba4856ac9dff27779d42ba19cdf415 /writerfilter
parent7b7e0ff7b78f2e745712c551e5efe7457987f136 (diff)
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>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index d31ca615de86..5af309e1cbcf 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2834,15 +2834,19 @@ void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32
{
double fontSize = 0;
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.
else if (aDefaultFont)
{
double fHeight = 0;
aDefaultFont->second >>= fHeight;
- // fHeight is in points, nIntValue is in half points, nEscapement is in percents.
- nEscapement = nIntValue * 100 / fHeight / 2;
+ 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