Skip to content

Commit 942f148

Browse files
oleibmanProgi1984
authored andcommitted
Very Minor Improvement
1 parent 52a7cbc commit 942f148

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/PhpWord/Writer/HTML/Element/Text.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ private function getParagraphStyle()
221221
$pStyleIsObject = ($paragraphStyle instanceof Paragraph);
222222
if ($pStyleIsObject) {
223223
$styleWriter = new ParagraphStyleWriter($paragraphStyle);
224+
/** @var HTML */
225+
$temp = $this->parentWriter;
226+
$styleWriter->setParentWriter($temp);
224227
$style = $styleWriter->write();
225228
} elseif (is_string($paragraphStyle)) {
226229
$style = $paragraphStyle;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function write()
9595
}
9696
$ind = $style->getIndentation();
9797
if ($ind != null) {
98-
$tcpdf = ($this->getParentWriter() === null) ? false : $this->getParentWriter()->isTcpdf(); // @phpstan-ignore-line
98+
$tcpdf = $this->getParentWriter()->isTcpdf();
9999
$left = $ind->getLeft();
100100
$inches = $left * 1.0 / \PhpOffice\PhpWord\Shared\Converter::INCH_TO_TWIP;
101101
$css[$tcpdf ? 'text-indent' : 'margin-left'] = ((string) $inches) . 'in';

0 commit comments

Comments
 (0)