Skip to content

Commit

Permalink
Merge 037ec30 into ad70328
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Dec 11, 2023
2 parents ad70328 + 037ec30 commit 425b29b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changes/1.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- PowerPoint2007 Writer : Fixed broken video file relationship - [@potofcoffee](https://github.com/potofcoffee) in [#776](https://github.com/PHPOffice/PHPPresentation/pull/776)
- PowerPoint2007 Writer : Fixed issue when first element in series is null - [@ksmeeks0001](https://github.com/ksmeeks0001) in [#778](https://github.com/PHPOffice/PHPPresentation/pull/778)
- PowerPoint2007 & ODPresentation Writer : Use of the disk caching directory for temporary files - [@nhalle](https://github.com/nhalle) in [#781](https://github.com/PHPOffice/PHPPresentation/pull/781)
- PowerPoint2007 Reader : Fixed reading of RichText shape in Note - [@aelliott1485](https://github.com/aelliott1485) in [#782](https://github.com/PHPOffice/PHPPresentation/pull/782)

## Miscellaneous

Expand Down
13 changes: 10 additions & 3 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,10 @@ protected function loadShapeDrawing(XMLReader $document, DOMElement $node, Abstr
$oSlide->addShape($oShape);
}

protected function loadShapeRichText(XMLReader $document, DOMElement $node, AbstractSlide $oSlide): void
/**
* @param AbstractSlide|Note $oSlide
*/
protected function loadShapeRichText(XMLReader $document, DOMElement $node, $oSlide): void
{
if (!$document->elementExists('p:txBody/a:p/a:r', $node)) {
return;
Expand Down Expand Up @@ -1386,11 +1389,15 @@ protected function loadSlideShapes($oSlide, DOMNodeList $oElements, XMLReader $x
}
switch ($oNode->tagName) {
case 'p:graphicFrame':
$this->loadShapeTable($xmlReader, $oNode, $oSlide);
if ($oSlide instanceof AbstractSlide) {
$this->loadShapeTable($xmlReader, $oNode, $oSlide);
}

break;
case 'p:pic':
$this->loadShapeDrawing($xmlReader, $oNode, $oSlide);
if ($oSlide instanceof AbstractSlide) {
$this->loadShapeDrawing($xmlReader, $oNode, $oSlide);
}

break;
case 'p:sp':
Expand Down
8 changes: 8 additions & 0 deletions tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,4 +643,12 @@ public function testLoadFileWithInvalidImages(): void
self::assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation);
self::assertEquals(1, $oPhpPresentation->getSlideCount());
}

public function testLoadingFileWithNoteInSlide(): void
{
$file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/PPTX_SlideNoteWithRichText.pptx';
$object = new PowerPoint2007();
$oPhpPresentation = $object->load($file);
self::assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation);
}
}
Binary file not shown.

0 comments on commit 425b29b

Please sign in to comment.