Skip to content

Commit

Permalink
PHPExcel calls not compatible with namespacing
Browse files Browse the repository at this point in the history
The non-namespaced PHPExcel components need to be referenced with a leading slash, otherwise the current namespace (PhpOffice\PhpPowerpoint\Writer\PowerPoint2007) will be searched first.
  • Loading branch information
lars-feyerabend authored and Lars Feyerabend committed Sep 24, 2014
1 parent 87d41ad commit f7c07c2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/PhpPowerpoint/Writer/PowerPoint2007/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function writeSpreadsheet(PHPPowerPoint $presentation, $chart, $tempName)
}

// Create new spreadsheet
$workbook = new PHPExcel();
$workbook = new \PHPExcel();

// Set properties
$title = $chart->getTitle()->getText();
Expand Down Expand Up @@ -255,7 +255,7 @@ public function writeSpreadsheet(PHPPowerPoint $presentation, $chart, $tempName)
}

// Save to string
$writer = PHPExcel_IOFactory::createWriter($workbook, 'Excel2007');
$writer = \PHPExcel_IOFactory::createWriter($workbook, 'Excel2007');
$writer->save($tempName);

// Load file in memory
Expand Down Expand Up @@ -932,7 +932,7 @@ protected function writeTypeBar3D(XMLWriter $objWriter, Bar3D $subject, $include

// c:tx
$objWriter->startElement('c:tx');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$this->writeSingleValueOrReference($objWriter, $includeSheet, $series->getTitle(), $coords);
$objWriter->endElement();

Expand Down Expand Up @@ -1058,7 +1058,7 @@ protected function writeTypeBar3D(XMLWriter $objWriter, Bar3D $subject, $include

// c:val
$objWriter->startElement('c:val');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$this->writeMultipleValuesOrReference($objWriter, $includeSheet, $axisYData, $coords);
$objWriter->endElement();

Expand Down Expand Up @@ -1131,7 +1131,7 @@ protected function writeTypePie3D(XMLWriter $objWriter, Pie3D $subject, $include

// c:tx
$objWriter->startElement('c:tx');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$this->writeSingleValueOrReference($objWriter, $includeSheet, $series->getTitle(), $coords);
$objWriter->endElement();

Expand Down Expand Up @@ -1257,7 +1257,7 @@ protected function writeTypePie3D(XMLWriter $objWriter, Pie3D $subject, $include

// c:val
$objWriter->startElement('c:val');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$this->writeMultipleValuesOrReference($objWriter, $includeSheet, $axisYData, $coords);
$objWriter->endElement();

Expand Down Expand Up @@ -1310,7 +1310,7 @@ protected function writeTypeLine(XMLWriter $objWriter, Line $subject, $includeSh

// c:tx
$objWriter->startElement('c:tx');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$this->writeSingleValueOrReference($objWriter, $includeSheet, $series->getTitle(), $coords);
$objWriter->endElement();

Expand Down Expand Up @@ -1416,7 +1416,7 @@ protected function writeTypeLine(XMLWriter $objWriter, Line $subject, $includeSh

// c:val
$objWriter->startElement('c:val');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$this->writeMultipleValuesOrReference($objWriter, $includeSheet, $axisYData, $coords);
$objWriter->endElement();

Expand Down Expand Up @@ -1494,7 +1494,7 @@ protected function writeTypeScatter(XMLWriter $objWriter, Scatter $subject, $inc

// c:tx
$objWriter->startElement('c:tx');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex(1 + $seriesIndex) . '$1' : '');
$this->writeSingleValueOrReference($objWriter, $includeSheet, $series->getTitle(), $coords);
$objWriter->endElement();

Expand Down Expand Up @@ -1614,7 +1614,7 @@ protected function writeTypeScatter(XMLWriter $objWriter, Scatter $subject, $inc

// c:yVal
$objWriter->startElement('c:yVal');
$coords = ($includeSheet ? 'Sheet1!$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$coords = ($includeSheet ? 'Sheet1!$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$2:$' . \PHPExcel_Cell::stringFromColumnIndex($seriesIndex + 1) . '$' . (1 + count($axisYData)) : '');
$this->writeMultipleValuesOrReference($objWriter, $includeSheet, $axisYData, $coords);
$objWriter->endElement();

Expand Down

0 comments on commit f7c07c2

Please sign in to comment.