Skip to content

Commit

Permalink
Merge pull request #401 from Progi1984/issue397
Browse files Browse the repository at this point in the history
#397 : PowerPoint2007 Reader : Background Color based on SchemeColor
  • Loading branch information
Progi1984 authored Sep 8, 2017
2 parents e67d8ef + 9b09bb1 commit ee77db7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
### Changes
- PHP 7.1 is now supported - @Progi1984 GH-355
- PhpOffice\PhpPresentation\Style\Color : Define only the transparency - @Progi1984 GH-370
- PowerPoint2007 Reader : Background Color based on SchemeColor - @Progi1984 GH-397

### Features
- ODPresentation Writer : Support for the position of Legend - @Progi1984 GH-355
Expand Down
12 changes: 12 additions & 0 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,18 @@ protected function loadSlide($sPart, $baseFile)
$oSlide = $this->oPhpPresentation->getActiveSlide();
$oSlide->setBackground($oBackground);
}
$oElementColor = $xmlReader->getElement('a:solidFill/a:schemeClr', $oElement);
if ($oElementColor instanceof \DOMElement) {
// Color
$oColor = new SchemeColor();
$oColor->setValue($oElementColor->hasAttribute('val') ? $oElementColor->getAttribute('val') : null);
// Background
$oBackground = new Slide\Background\SchemeColor();
$oBackground->setSchemeColor($oColor);
// Slide Background
$oSlide = $this->oPhpPresentation->getActiveSlide();
$oSlide->setBackground($oBackground);
}
$oElementImage = $xmlReader->getElement('a:blipFill/a:blip', $oElement);
if ($oElementImage instanceof \DOMElement) {
$relImg = $this->arrayRels['ppt/slides/_rels/' . $baseFile . '.rels'][$oElementImage->getAttribute('r:embed')];
Expand Down

0 comments on commit ee77db7

Please sign in to comment.