Skip to content

Commit 1b9c1d9

Browse files
committed
format
1 parent 75bf84f commit 1b9c1d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PhpWord/Writer/ODText/Style/Paragraph.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function write()
3535
}
3636
$xmlWriter = $this->getXmlWriter();
3737

38-
$marginTop = ($style->getSpaceBefore() ==0 ) ? '0' : round(17.6 / $style->getSpaceBefore(), 2);
39-
$marginBottom = ($style->getSpaceAfter() == 0) ? '0' : round(17.6 / $style->getSpaceAfter(), 2);
38+
$marginTop = (is_null($style->getSpaceBefore()) || $style->getSpaceBefore() == 0) ? '0' : round(17.6 / $style->getSpaceBefore(), 2);
39+
$marginBottom = (is_null($style->getSpaceAfter()) || $style->getSpaceAfter() == 0) ? '0' : round(17.6 / $style->getSpaceAfter(), 2);
4040

4141
$xmlWriter->startElement('style:style');
4242
$xmlWriter->writeAttribute('style:name', $style->getStyleName());

0 commit comments

Comments
 (0)