From 1b9c1d921b22cb87e17e0848ab00b785f370328a Mon Sep 17 00:00:00 2001 From: troosan Date: Tue, 7 Nov 2017 22:38:30 +0100 Subject: [PATCH] format --- src/PhpWord/Writer/ODText/Style/Paragraph.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpWord/Writer/ODText/Style/Paragraph.php b/src/PhpWord/Writer/ODText/Style/Paragraph.php index 68613855..14a811a5 100644 --- a/src/PhpWord/Writer/ODText/Style/Paragraph.php +++ b/src/PhpWord/Writer/ODText/Style/Paragraph.php @@ -35,8 +35,8 @@ class Paragraph extends AbstractStyle } $xmlWriter = $this->getXmlWriter(); - $marginTop = ($style->getSpaceBefore() ==0 ) ? '0' : round(17.6 / $style->getSpaceBefore(), 2); - $marginBottom = ($style->getSpaceAfter() == 0) ? '0' : round(17.6 / $style->getSpaceAfter(), 2); + $marginTop = (is_null($style->getSpaceBefore()) || $style->getSpaceBefore() == 0) ? '0' : round(17.6 / $style->getSpaceBefore(), 2); + $marginBottom = (is_null($style->getSpaceAfter()) || $style->getSpaceAfter() == 0) ? '0' : round(17.6 / $style->getSpaceAfter(), 2); $xmlWriter->startElement('style:style'); $xmlWriter->writeAttribute('style:name', $style->getStyleName());