Skip to content

Commit

Permalink
Very Minor Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
oleibman authored and Progi1984 committed Nov 8, 2023
1 parent 52a7cbc commit 942f148
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/PhpWord/Writer/HTML/Element/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ private function getParagraphStyle()
$pStyleIsObject = ($paragraphStyle instanceof Paragraph);
if ($pStyleIsObject) {
$styleWriter = new ParagraphStyleWriter($paragraphStyle);
/** @var HTML */
$temp = $this->parentWriter;
$styleWriter->setParentWriter($temp);
$style = $styleWriter->write();
} elseif (is_string($paragraphStyle)) {
$style = $paragraphStyle;
Expand Down
2 changes: 1 addition & 1 deletion src/PhpWord/Writer/HTML/Style/Paragraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function write()
}
$ind = $style->getIndentation();
if ($ind != null) {
$tcpdf = ($this->getParentWriter() === null) ? false : $this->getParentWriter()->isTcpdf(); // @phpstan-ignore-line
$tcpdf = $this->getParentWriter()->isTcpdf();
$left = $ind->getLeft();
$inches = $left * 1.0 / \PhpOffice\PhpWord\Shared\Converter::INCH_TO_TWIP;
$css[$tcpdf ? 'text-indent' : 'margin-left'] = ((string) $inches) . 'in';
Expand Down

0 comments on commit 942f148

Please sign in to comment.