Skip to content

Commit

Permalink
Merge pull request #294 from jrking4/develop
Browse files Browse the repository at this point in the history
Fix Missing SlideLayout
  • Loading branch information
Progi1984 authored Nov 16, 2016
2 parents 2e9a958 + 0ba3e33 commit c7ca3b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.8.0 - WIP

### Bugfix
- PowerPoint2007 Writer : The presentation need repairs on Mac @jrking4 GH-266 GH-276

## 0.7.0 - 2016-09-12

### Bugfix
Expand Down
3 changes: 2 additions & 1 deletion src/PhpPresentation/Writer/PowerPoint2007/PptSlides.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ protected function writeSlideRelationships(Slide $pSlide)
$idxSlide = $pSlide->getParent()->getIndex($pSlide);

// Write slideLayout relationship
$layoutId = 1;
if ($pSlide->getSlideLayout()) {
$layoutId = $pSlide->getSlideLayout()->layoutNr;
$this->writeRelationship($objWriter, $relId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout', '../slideLayouts/slideLayout' . $layoutId . '.xml');
}
$this->writeRelationship($objWriter, $relId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout', '../slideLayouts/slideLayout' . $layoutId . '.xml');

// Write drawing relationships?
if ($pSlide->getShapeCollection()->count() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,14 @@ public function testRichTextVertical()
$this->assertEquals('vert', $pres->getElementAttribute($element, 'vert', 'ppt/slides/slide1.xml'));
}

public function testSlideLayoutExists()
{
$oPhpPresentation = new PhpPresentation();

$pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007');
$this->assertTrue($pres->fileExists('ppt/slideLayouts/slideLayout1.xml'));
}

public function testStyleSubScript()
{
$oPhpPresentation = new PhpPresentation();
Expand Down

0 comments on commit c7ca3b4

Please sign in to comment.