From 19ea091e54f7b33719602109dc92094020a436e5 Mon Sep 17 00:00:00 2001 From: Phil Wilkinson Date: Thu, 12 Jun 2025 12:42:06 +0100 Subject: [PATCH 1/2] Added support for loading text run without properties --- src/PhpPresentation/Reader/PowerPoint2007.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php index d93a19168..09ec12f9e 100644 --- a/src/PhpPresentation/Reader/PowerPoint2007.php +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -1511,9 +1511,9 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh } if ('a:r' == $oSubElement->tagName) { $oElementrPr = $document->getElement('a:rPr', $oSubElement); - if (is_object($oElementrPr)) { - $oText = $oParagraph->createTextRun(); + $oText = $oParagraph->createTextRun(); + if (is_object($oElementrPr)) { if ($oElementrPr->hasAttribute('b')) { $att = $oElementrPr->getAttribute('b'); $oText->getFont()->setBold('true' == $att || '1' == $att ? true : false); @@ -1591,10 +1591,9 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh $oText->getFont()->setCharset((int) $oElementFont->getAttribute('charset')); } } - - $oSubSubElement = $document->getElement('a:t', $oSubElement); - $oText->setText($oSubSubElement->nodeValue); } + $oSubSubElement = $document->getElement('a:t', $oSubElement); + $oText->setText($oSubSubElement->nodeValue); } } } From 9a29a9b984b7d2e24c48fef627735973ca59bbb5 Mon Sep 17 00:00:00 2001 From: Phil Wilkinson Date: Mon, 27 Oct 2025 12:17:41 +0000 Subject: [PATCH 2/2] Updated changelog --- docs/changes/1.3.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changes/1.3.0.md b/docs/changes/1.3.0.md index 33b870b7a..1043782de 100644 --- a/docs/changes/1.3.0.md +++ b/docs/changes/1.3.0.md @@ -4,6 +4,6 @@ ## Enhancements - `phpoffice/phpspreadsheet`: Allow version 5.0 by [@seanlynchwv](http://github.com/seanlynchwv) in [#879](https://github.com/PHPOffice/PHPPresentation/pull/879) +- PowerPoint2007 Reader: Added support for loading text run without properties by [@Wilkolicious](http://github.com/Wilkolicious) in [#871](https://github.com/PHPOffice/PHPPresentation/pull/871) ## Bug fixes -