diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-01-07 15:14:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-01-07 21:06:57 +0100 |
commit | 9dad387df78f4043ca0c718f27ed06006fa7128a (patch) | |
tree | a0f75c4b6dea22bffcd649001c3e14a0556d534c /lotuswordpro | |
parent | 44b938040f312def227c9ed72d1f83811cf67f1a (diff) |
ofz#4979 Divide-by-zero
Change-Id: I0ac848950bdab54a8cc2659206758f1b13e32757
Reviewed-on: https://gerrit.libreoffice.org/47536
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 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwppagelayout.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 193bdbbedb69..8ee43071bb95 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -288,9 +288,13 @@ void LwpPageLayout::ParseFootNoteSeparator(XFPageMaster * pm1) enumXFAlignType eAlignType = enumXFAlignStart; if(rFootnoteSep.GetIndent() > 0) { + const double fMarginWidth = GetMarginWidth(); + if (fMarginWidth == 0.0) + throw o3tl::divide_by_zero(); + //SODC don't support indent - sal_uInt32 nIndentPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetIndent())/GetMarginWidth()); - if(nIndentPercent + nLengthPercent >= 100) + sal_uInt32 nIndentPercent = static_cast<sal_uInt32>(100*LwpTools::ConvertFromUnitsToMetric(rFootnoteSep.GetIndent()) / fMarginWidth); + if (nIndentPercent + nLengthPercent >= 100) eAlignType = enumXFAlignEnd; } if(aColor.IsValidColor()) |