Merge pull request #887 from taophp/patch-1

Fix division by zero
This commit is contained in:
troosan 2017-11-07 22:34:49 +01:00 committed by GitHub
commit 75bf84fa48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,8 +35,8 @@ class Paragraph extends AbstractStyle
}
$xmlWriter = $this->getXmlWriter();
$marginTop = is_null($style->getSpaceBefore()) ? '0' : round(17.6 / $style->getSpaceBefore(), 2);
$marginBottom = is_null($style->getSpaceAfter()) ? '0' : round(17.6 / $style->getSpaceAfter(), 2);
$marginTop = ($style->getSpaceBefore() ==0 ) ? '0' : round(17.6 / $style->getSpaceBefore(), 2);
$marginBottom = ($style->getSpaceAfter() == 0) ? '0' : round(17.6 / $style->getSpaceAfter(), 2);
$xmlWriter->startElement('style:style');
$xmlWriter->writeAttribute('style:name', $style->getStyleName());