PSR-2 : Fixes

This commit is contained in:
Progi1984 2015-05-13 12:27:01 +02:00
parent 06c1ea78de
commit 2881bca443
69 changed files with 2858 additions and 2994 deletions

View File

@ -304,7 +304,8 @@ class PHPExcel_Chart
* @param PHPExcel_Chart_Title $label * @param PHPExcel_Chart_Title $label
* @return PHPExcel_Chart * @return PHPExcel_Chart
*/ */
public function setYAxisLabel(PHPExcel_Chart_Title $label) { public function setYAxisLabel(PHPExcel_Chart_Title $label)
{
$this->_yAxisLabel = $label; $this->_yAxisLabel = $label;
return $this; return $this;

View File

@ -442,8 +442,7 @@ class PHPExcel_Shared_String
$data = pack('CC', $ln, $opt); $data = pack('CC', $ln, $opt);
// characters // characters
$data .= self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); $data .= self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8');
} } else {
else {
$data = pack('vC', $ln, 0x09); $data = pack('vC', $ln, 0x09);
$data .= pack('v', count($arrcRuns)); $data .= pack('v', count($arrcRuns));
// characters // characters

View File

@ -98,7 +98,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
$sheet = $this->_phpExcel->getSheet($this->_sheetIndex); $sheet = $this->_phpExcel->getSheet($this->_sheetIndex);
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->getWriteDebugLog(); $saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->getWriteDebugLog();
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog(FALSE); PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog(false);
$saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
@ -143,7 +143,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* *
* @return string * @return string
*/ */
public function getDelimiter() { public function getDelimiter()
{
return $this->_delimiter; return $this->_delimiter;
} }
@ -153,7 +154,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* @param string $pValue Delimiter, defaults to , * @param string $pValue Delimiter, defaults to ,
* @return PHPExcel_Writer_CSV * @return PHPExcel_Writer_CSV
*/ */
public function setDelimiter($pValue = ',') { public function setDelimiter($pValue = ',')
{
$this->_delimiter = $pValue; $this->_delimiter = $pValue;
return $this; return $this;
} }
@ -163,7 +165,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* *
* @return string * @return string
*/ */
public function getEnclosure() { public function getEnclosure()
{
return $this->_enclosure; return $this->_enclosure;
} }
@ -173,7 +176,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* @param string $pValue Enclosure, defaults to " * @param string $pValue Enclosure, defaults to "
* @return PHPExcel_Writer_CSV * @return PHPExcel_Writer_CSV
*/ */
public function setEnclosure($pValue = '"') { public function setEnclosure($pValue = '"')
{
if ($pValue == '') { if ($pValue == '') {
$pValue = null; $pValue = null;
} }
@ -186,7 +190,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* *
* @return string * @return string
*/ */
public function getLineEnding() { public function getLineEnding()
{
return $this->_lineEnding; return $this->_lineEnding;
} }
@ -196,7 +201,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* @param string $pValue Line ending, defaults to OS line ending (PHP_EOL) * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL)
* @return PHPExcel_Writer_CSV * @return PHPExcel_Writer_CSV
*/ */
public function setLineEnding($pValue = PHP_EOL) { public function setLineEnding($pValue = PHP_EOL)
{
$this->_lineEnding = $pValue; $this->_lineEnding = $pValue;
return $this; return $this;
} }
@ -206,7 +212,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* *
* @return boolean * @return boolean
*/ */
public function getUseBOM() { public function getUseBOM()
{
return $this->_useBOM; return $this->_useBOM;
} }
@ -216,7 +223,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* @param boolean $pValue Use UTF-8 byte-order mark? Defaults to false * @param boolean $pValue Use UTF-8 byte-order mark? Defaults to false
* @return PHPExcel_Writer_CSV * @return PHPExcel_Writer_CSV
*/ */
public function setUseBOM($pValue = false) { public function setUseBOM($pValue = false)
{
$this->_useBOM = $pValue; $this->_useBOM = $pValue;
return $this; return $this;
} }
@ -226,7 +234,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* *
* @return boolean * @return boolean
*/ */
public function getExcelCompatibility() { public function getExcelCompatibility()
{
return $this->_excelCompatibility; return $this->_excelCompatibility;
} }
@ -237,7 +246,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* Note that this overrides other settings such as useBOM, enclosure and delimiter * Note that this overrides other settings such as useBOM, enclosure and delimiter
* @return PHPExcel_Writer_CSV * @return PHPExcel_Writer_CSV
*/ */
public function setExcelCompatibility($pValue = false) { public function setExcelCompatibility($pValue = false)
{
$this->_excelCompatibility = $pValue; $this->_excelCompatibility = $pValue;
return $this; return $this;
} }
@ -247,7 +257,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* *
* @return int * @return int
*/ */
public function getSheetIndex() { public function getSheetIndex()
{
return $this->_sheetIndex; return $this->_sheetIndex;
} }
@ -257,7 +268,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* @param int $pValue Sheet index * @param int $pValue Sheet index
* @return PHPExcel_Writer_CSV * @return PHPExcel_Writer_CSV
*/ */
public function setSheetIndex($pValue = 0) { public function setSheetIndex($pValue = 0)
{
$this->_sheetIndex = $pValue; $this->_sheetIndex = $pValue;
return $this; return $this;
} }
@ -269,7 +281,8 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* @param array $pValues Array containing values in a row * @param array $pValues Array containing values in a row
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeLine($pFileHandle = null, $pValues = null) { private function _writeLine($pFileHandle = null, $pValues = null)
{
if (is_array($pValues)) { if (is_array($pValues)) {
// No leading delimiter // No leading delimiter
$writeDelimiter = false; $writeDelimiter = false;
@ -301,5 +314,4 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
throw new PHPExcel_Writer_Exception("Invalid data row passed to CSV writer."); throw new PHPExcel_Writer_Exception("Invalid data row passed to CSV writer.");
} }
} }
} }

View File

@ -163,7 +163,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* @param string $pPartName Writer part name * @param string $pPartName Writer part name
* @return PHPExcel_Writer_Excel2007_WriterPart * @return PHPExcel_Writer_Excel2007_WriterPart
*/ */
public function getWriterPart($pPartName = '') { public function getWriterPart($pPartName = '')
{
if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) { if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) {
return $this->_writerParts[strtolower($pPartName)]; return $this->_writerParts[strtolower($pPartName)];
} else { } else {
@ -179,7 +180,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
*/ */
public function save($pFilename = null) public function save($pFilename = null)
{ {
if ($this->_spreadSheet !== NULL) { if ($this->_spreadSheet !== null) {
// garbage collect // garbage collect
$this->_spreadSheet->garbageCollect(); $this->_spreadSheet->garbageCollect();
@ -193,7 +194,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
} }
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_spreadSheet)->getDebugLog()->getWriteDebugLog(); $saveDebugLog = PHPExcel_Calculation::getInstance($this->_spreadSheet)->getDebugLog()->getWriteDebugLog();
PHPExcel_Calculation::getInstance($this->_spreadSheet)->getDebugLog()->setWriteDebugLog(FALSE); PHPExcel_Calculation::getInstance($this->_spreadSheet)->getDebugLog()->setWriteDebugLog(false);
$saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType(); $saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
@ -245,8 +246,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
if ($this->_spreadSheet->hasMacrosCertificate()) {//signed macros ? if ($this->_spreadSheet->hasMacrosCertificate()) {//signed macros ?
// Yes : add the certificate file and the related rels file // Yes : add the certificate file and the related rels file
$objZip->addFromString('xl/vbaProjectSignature.bin', $this->_spreadSheet->getMacrosCertificate()); $objZip->addFromString('xl/vbaProjectSignature.bin', $this->_spreadSheet->getMacrosCertificate());
$objZip->addFromString('xl/_rels/vbaProject.bin.rels', $objZip->addFromString('xl/_rels/vbaProject.bin.rels', $this->getWriterPart('RelsVBA')->writeVBARelationships($this->_spreadSheet));
$this->getWriterPart('RelsVBA')->writeVBARelationships($this->_spreadSheet));
} }
} }
} }
@ -261,8 +261,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
$objZip->addFromString($tmpRootPath.$aPath, $aContent); $objZip->addFromString($tmpRootPath.$aPath, $aContent);
} }
//the rels for files //the rels for files
$objZip->addFromString($tmpRootPath.'_rels/'.basename($tmpRibbonTarget).'.rels', $objZip->addFromString($tmpRootPath.'_rels/'.basename($tmpRibbonTarget).'.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->_spreadSheet));
$this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->_spreadSheet));
} }
} }
@ -274,7 +273,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
$objZip->addFromString('docProps/app.xml', $this->getWriterPart('DocProps')->writeDocPropsApp($this->_spreadSheet)); $objZip->addFromString('docProps/app.xml', $this->getWriterPart('DocProps')->writeDocPropsApp($this->_spreadSheet));
$objZip->addFromString('docProps/core.xml', $this->getWriterPart('DocProps')->writeDocPropsCore($this->_spreadSheet)); $objZip->addFromString('docProps/core.xml', $this->getWriterPart('DocProps')->writeDocPropsCore($this->_spreadSheet));
$customPropertiesPart = $this->getWriterPart('DocProps')->writeDocPropsCustom($this->_spreadSheet); $customPropertiesPart = $this->getWriterPart('DocProps')->writeDocPropsCustom($this->_spreadSheet);
if ($customPropertiesPart !== NULL) { if ($customPropertiesPart !== null) {
$objZip->addFromString('docProps/custom.xml', $customPropertiesPart); $objZip->addFromString('docProps/custom.xml', $customPropertiesPart);
} }
@ -308,7 +307,6 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
$chartRef1 = $chartRef2 = 0; $chartRef1 = $chartRef2 = 0;
// Add worksheet relationships (drawings, ...) // Add worksheet relationships (drawings, ...)
for ($i = 0; $i < $this->_spreadSheet->getSheetCount(); ++$i) { for ($i = 0; $i < $this->_spreadSheet->getSheetCount(); ++$i) {
// Add relationships // Add relationships
$objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->_spreadSheet->getSheet($i), ($i + 1), $this->_includeCharts)); $objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->_spreadSheet->getSheet($i), ($i + 1), $this->_includeCharts));
@ -409,7 +407,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* @return PHPExcel * @return PHPExcel
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function getPHPExcel() { public function getPHPExcel()
{
if ($this->_spreadSheet !== null) { if ($this->_spreadSheet !== null) {
return $this->_spreadSheet; return $this->_spreadSheet;
} else { } else {
@ -424,7 +423,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
* @return PHPExcel_Writer_Excel2007 * @return PHPExcel_Writer_Excel2007
*/ */
public function setPHPExcel(PHPExcel $pPHPExcel = null) { public function setPHPExcel(PHPExcel $pPHPExcel = null)
{
$this->_spreadSheet = $pPHPExcel; $this->_spreadSheet = $pPHPExcel;
return $this; return $this;
} }
@ -434,7 +434,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return string[] * @return string[]
*/ */
public function getStringTable() { public function getStringTable()
{
return $this->_stringTable; return $this->_stringTable;
} }
@ -443,7 +444,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return PHPExcel_HashTable * @return PHPExcel_HashTable
*/ */
public function getStyleHashTable() { public function getStyleHashTable()
{
return $this->_styleHashTable; return $this->_styleHashTable;
} }
@ -452,7 +454,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return PHPExcel_HashTable * @return PHPExcel_HashTable
*/ */
public function getStylesConditionalHashTable() { public function getStylesConditionalHashTable()
{
return $this->_stylesConditionalHashTable; return $this->_stylesConditionalHashTable;
} }
@ -461,7 +464,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return PHPExcel_HashTable * @return PHPExcel_HashTable
*/ */
public function getFillHashTable() { public function getFillHashTable()
{
return $this->_fillHashTable; return $this->_fillHashTable;
} }
@ -470,7 +474,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return PHPExcel_HashTable * @return PHPExcel_HashTable
*/ */
public function getFontHashTable() { public function getFontHashTable()
{
return $this->_fontHashTable; return $this->_fontHashTable;
} }
@ -479,7 +484,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return PHPExcel_HashTable * @return PHPExcel_HashTable
*/ */
public function getBordersHashTable() { public function getBordersHashTable()
{
return $this->_bordersHashTable; return $this->_bordersHashTable;
} }
@ -488,7 +494,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return PHPExcel_HashTable * @return PHPExcel_HashTable
*/ */
public function getNumFmtHashTable() { public function getNumFmtHashTable()
{
return $this->_numFmtHashTable; return $this->_numFmtHashTable;
} }
@ -497,7 +504,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return PHPExcel_HashTable * @return PHPExcel_HashTable
*/ */
public function getDrawingHashTable() { public function getDrawingHashTable()
{
return $this->_drawingHashTable; return $this->_drawingHashTable;
} }
@ -506,7 +514,8 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* *
* @return boolean * @return boolean
*/ */
public function getOffice2003Compatibility() { public function getOffice2003Compatibility()
{
return $this->_office2003compatibility; return $this->_office2003compatibility;
} }
@ -516,9 +525,9 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
* @param boolean $pValue Office2003 compatibility? * @param boolean $pValue Office2003 compatibility?
* @return PHPExcel_Writer_Excel2007 * @return PHPExcel_Writer_Excel2007
*/ */
public function setOffice2003Compatibility($pValue = false) { public function setOffice2003Compatibility($pValue = false)
{
$this->_office2003compatibility = $pValue; $this->_office2003compatibility = $pValue;
return $this; return $this;
} }
} }

View File

@ -32,9 +32,7 @@
* @package PHPExcel_Writer_Excel2007 * @package PHPExcel_Writer_Excel2007
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class PHPExcel_Writer_Excel2007_Chart extends class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPart {
PHPExcel_Writer_Excel2007_WriterPart {
/** /**
* Write charts to XML format * Write charts to XML format
* *
@ -43,14 +41,11 @@ class PHPExcel_Writer_Excel2007_Chart extends
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeChart(PHPExcel_Chart $pChart = NULL) { public function writeChart(PHPExcel_Chart $pChart = null) {
// Create XML writer // Create XML writer
$objWriter = NULL; $objWriter = null;
if ($this->getParentWriter() if ($this->getParentWriter()->getUseDiskCaching()) {
->getUseDiskCaching() $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()
->getDiskCachingDirectory());
} else { } else {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
} }
@ -86,17 +81,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->writeAttribute('val', 0); $objWriter->writeAttribute('val', 0);
$objWriter->endElement(); $objWriter->endElement();
$this->_writePlotArea( $this->_writePlotArea($pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $objWriter, $pChart->getWorksheet(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines());
$pChart->getPlotArea(),
$pChart->getXAxisLabel(),
$pChart->getYAxisLabel(),
$objWriter,
$pChart->getWorksheet(),
$pChart->getChartAxisX(),
$pChart->getChartAxisY(),
$pChart->getMajorGridlines(),
$pChart->getMinorGridlines()
);
$this->_writeLegend($pChart->getLegend(), $objWriter); $this->_writeLegend($pChart->getLegend(), $objWriter);
@ -130,7 +115,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeTitle(PHPExcel_Chart_Title $title = NULL, $objWriter) { private function _writeTitle(PHPExcel_Chart_Title $title = null, $objWriter) {
if (is_null($title)) { if (is_null($title)) {
return; return;
} }
@ -151,16 +136,13 @@ class PHPExcel_Writer_Excel2007_Chart extends
if ((is_array($caption)) && (count($caption) > 0)) { if ((is_array($caption)) && (count($caption) > 0)) {
$caption = $caption[0]; $caption = $caption[0];
} }
$this->getParentWriter() $this->getParentWriter()->getWriterPart('stringtable')->writeRichTextForCharts($objWriter, $caption, 'a');
->getWriterPart('stringtable')
->writeRichTextForCharts($objWriter, $caption, 'a');
$objWriter->endElement(); $objWriter->endElement();
$objWriter->endElement(); $objWriter->endElement();
$objWriter->endElement(); $objWriter->endElement();
$layout = $title->getLayout(); $this->_writeLayout($title->getLayout(), $objWriter);
$this->_writeLayout($layout, $objWriter);
$objWriter->startElement('c:overlay'); $objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', 0); $objWriter->writeAttribute('val', 0);
@ -177,7 +159,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeLegend(PHPExcel_Chart_Legend $legend = NULL, $objWriter) { private function _writeLegend(PHPExcel_Chart_Legend $legend = null, $objWriter) {
if (is_null($legend)) { if (is_null($legend)) {
return; return;
} }
@ -188,8 +170,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->writeAttribute('val', $legend->getPosition()); $objWriter->writeAttribute('val', $legend->getPosition());
$objWriter->endElement(); $objWriter->endElement();
$layout = $legend->getLayout(); $this->_writeLayout($legend->getLayout(), $objWriter);
$this->_writeLayout($layout, $objWriter);
$objWriter->startElement('c:overlay'); $objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', ($legend->getOverlay()) ? '1' : '0'); $objWriter->writeAttribute('val', ($legend->getOverlay()) ? '1' : '0');
@ -232,16 +213,8 @@ class PHPExcel_Writer_Excel2007_Chart extends
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writePlotArea(PHPExcel_Chart_PlotArea $plotArea, private function _writePlotArea(PHPExcel_Chart_PlotArea $plotArea, PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, $objWriter, PHPExcel_Worksheet $pSheet, PHPExcel_Chart_Axis $xAxis, PHPExcel_Chart_Axis $yAxis, PHPExcel_Chart_GridLines $majorGridlines, PHPExcel_Chart_GridLines $minorGridlines )
PHPExcel_Chart_Title $xAxisLabel = NULL, {
PHPExcel_Chart_Title $yAxisLabel = NULL,
$objWriter,
PHPExcel_Worksheet $pSheet,
PHPExcel_Chart_Axis $xAxis,
PHPExcel_Chart_Axis $yAxis,
PHPExcel_Chart_GridLines $majorGridlines,
PHPExcel_Chart_GridLines $minorGridlines
) {
if (is_null($plotArea)) { if (is_null($plotArea)) {
return; return;
} }
@ -255,7 +228,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
$this->_writeLayout($layout, $objWriter); $this->_writeLayout($layout, $objWriter);
$chartTypes = self::_getChartType($plotArea); $chartTypes = self::_getChartType($plotArea);
$catIsMultiLevelSeries = $valIsMultiLevelSeries = FALSE; $catIsMultiLevelSeries = $valIsMultiLevelSeries = false;
$plotGroupingType = ''; $plotGroupingType = '';
foreach ($chartTypes as $chartType) { foreach ($chartTypes as $chartType) {
$objWriter->startElement('c:' . $chartType); $objWriter->startElement('c:' . $chartType);
@ -265,7 +238,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
$plotGroup = $plotArea->getPlotGroupByIndex($i); $plotGroup = $plotArea->getPlotGroupByIndex($i);
$groupType = $plotGroup->getPlotType(); $groupType = $plotGroup->getPlotType();
if ($groupType == $chartType) { if ($groupType == $chartType) {
$plotStyle = $plotGroup->getPlotStyle(); $plotStyle = $plotGroup->getPlotStyle();
if ($groupType === PHPExcel_Chart_DataSeries::TYPE_RADARCHART) { if ($groupType === PHPExcel_Chart_DataSeries::TYPE_RADARCHART) {
$objWriter->startElement('c:radarStyle'); $objWriter->startElement('c:radarStyle');
@ -289,24 +261,17 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->startElement('c:smooth'); $objWriter->startElement('c:smooth');
$objWriter->writeAttribute('val', (integer) $plotGroup->getSmoothLine()); $objWriter->writeAttribute('val', (integer) $plotGroup->getSmoothLine());
$objWriter->endElement(); $objWriter->endElement();
} elseif (($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) || } elseif (($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) ||($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) {
($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)
) {
$objWriter->startElement('c:gapWidth'); $objWriter->startElement('c:gapWidth');
$objWriter->writeAttribute('val', 150); $objWriter->writeAttribute('val', 150);
$objWriter->endElement(); $objWriter->endElement();
if ($plotGroupingType == 'percentStacked' || if ($plotGroupingType == 'percentStacked' || $plotGroupingType == 'stacked') {
$plotGroupingType == 'stacked'
) {
$objWriter->startElement('c:overlap'); $objWriter->startElement('c:overlap');
$objWriter->writeAttribute('val', 100); $objWriter->writeAttribute('val', 100);
$objWriter->endElement(); $objWriter->endElement();
} }
} elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { } elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
$objWriter->startElement('c:bubbleScale'); $objWriter->startElement('c:bubbleScale');
$objWriter->writeAttribute('val', 25); $objWriter->writeAttribute('val', 25);
$objWriter->endElement(); $objWriter->endElement();
@ -315,7 +280,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->writeAttribute('val', 0); $objWriter->writeAttribute('val', 0);
$objWriter->endElement(); $objWriter->endElement();
} elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_STOCKCHART) { } elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_STOCKCHART) {
$objWriter->startElement('c:hiLowLines'); $objWriter->startElement('c:hiLowLines');
$objWriter->endElement(); $objWriter->endElement();
@ -342,11 +306,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
$id1 = '75091328'; $id1 = '75091328';
$id2 = '75089408'; $id2 = '75089408';
if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) &&
($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)
) {
$objWriter->startElement('c:axId'); $objWriter->startElement('c:axId');
$objWriter->writeAttribute('val', $id1); $objWriter->writeAttribute('val', $id1);
$objWriter->endElement(); $objWriter->endElement();
@ -359,7 +319,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->endElement(); $objWriter->endElement();
if ($chartType === PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) { if ($chartType === PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) {
$objWriter->startElement('c:holeSize'); $objWriter->startElement('c:holeSize');
$objWriter->writeAttribute('val', 50); $objWriter->writeAttribute('val', 50);
$objWriter->endElement(); $objWriter->endElement();
@ -369,11 +328,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->endElement(); $objWriter->endElement();
} }
if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) &&
($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)
) {
if ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) { if ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
$this->_writeValAx($objWriter, $plotArea, $xAxisLabel, $chartType, $id1, $id2, $catIsMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines); $this->_writeValAx($objWriter, $plotArea, $xAxisLabel, $chartType, $id1, $id2, $catIsMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines);
} else { } else {
@ -507,7 +462,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->endElement(); $objWriter->endElement();
$objWriter->endElement(); $objWriter->endElement();
} }
$objWriter->startElement('c:numFmt'); $objWriter->startElement('c:numFmt');
@ -820,7 +774,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
} }
if (!is_null($yAxisLabel)) { if (!is_null($yAxisLabel)) {
$objWriter->startElement('c:title'); $objWriter->startElement('c:title');
$objWriter->startElement('c:tx'); $objWriter->startElement('c:tx');
$objWriter->startElement('c:rich'); $objWriter->startElement('c:rich');
@ -1030,7 +983,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('minor_unit')); $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('minor_unit'));
$objWriter->endElement(); $objWriter->endElement();
} }
} }
if ($isMultiLevelSeries) { if ($isMultiLevelSeries) {
@ -1042,7 +994,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
} }
$objWriter->endElement(); $objWriter->endElement();
} }
/** /**
@ -1053,20 +1004,15 @@ class PHPExcel_Writer_Excel2007_Chart extends
* @return string|array * @return string|array
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private private static function _getChartType($plotArea) {
static function _getChartType($plotArea) {
$groupCount = $plotArea->getPlotGroupCount(); $groupCount = $plotArea->getPlotGroupCount();
if ($groupCount == 1) { if ($groupCount == 1) {
$chartType = array( $chartType = array($plotArea->getPlotGroupByIndex(0)->getPlotType());
$plotArea->getPlotGroupByIndex(0)
->getPlotType()
);
} else { } else {
$chartTypes = array(); $chartTypes = array();
for ($i = 0; $i < $groupCount; ++$i) { for ($i = 0; $i < $groupCount; ++$i) {
$chartTypes[] = $plotArea->getPlotGroupByIndex($i) $chartTypes[] = $plotArea->getPlotGroupByIndex($i)->getPlotType();
->getPlotType();
} }
$chartType = array_unique($chartTypes); $chartType = array_unique($chartTypes);
if (count($chartTypes) == 0) { if (count($chartTypes) == 0) {
@ -1090,21 +1036,12 @@ class PHPExcel_Writer_Excel2007_Chart extends
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writePlotGroup($plotGroup, private function _writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, PHPExcel_Worksheet $pSheet ) {
$groupType,
$objWriter,
&$catIsMultiLevelSeries,
&$valIsMultiLevelSeries,
&$plotGroupingType,
PHPExcel_Worksheet $pSheet
) {
if (is_null($plotGroup)) { if (is_null($plotGroup)) {
return; return;
} }
if (($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART) || if (($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) {
($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)
) {
$objWriter->startElement('c:barDir'); $objWriter->startElement('c:barDir');
$objWriter->writeAttribute('val', $plotGroup->getPlotDirection()); $objWriter->writeAttribute('val', $plotGroup->getPlotDirection());
$objWriter->endElement(); $objWriter->endElement();
@ -1121,16 +1058,9 @@ class PHPExcel_Writer_Excel2007_Chart extends
$plotSeriesOrder = $plotGroup->getPlotOrder(); $plotSeriesOrder = $plotGroup->getPlotOrder();
$plotSeriesCount = count($plotSeriesOrder); $plotSeriesCount = count($plotSeriesOrder);
if (($groupType !== PHPExcel_Chart_DataSeries::TYPE_RADARCHART) && if (($groupType !== PHPExcel_Chart_DataSeries::TYPE_RADARCHART) && ($groupType !== PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)) {
($groupType !== PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)
) {
if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_LINECHART) { if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_LINECHART) {
if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) || ($plotSeriesCount > 1)) {
($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) ||
($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) ||
($plotSeriesCount > 1)
) {
$objWriter->startElement('c:varyColors'); $objWriter->startElement('c:varyColors');
$objWriter->writeAttribute('val', 1); $objWriter->writeAttribute('val', 1);
$objWriter->endElement(); $objWriter->endElement();
@ -1153,11 +1083,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->writeAttribute('val', $this->_seriesIndex + $plotSeriesRef); $objWriter->writeAttribute('val', $this->_seriesIndex + $plotSeriesRef);
$objWriter->endElement(); $objWriter->endElement();
if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) ||
($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)
) {
$objWriter->startElement('c:dPt'); $objWriter->startElement('c:dPt');
$objWriter->startElement('c:idx'); $objWriter->startElement('c:idx');
$objWriter->writeAttribute('val', 3); $objWriter->writeAttribute('val', 3);
@ -1188,9 +1114,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
} }
// Formatting for the points // Formatting for the points
if (($groupType == PHPExcel_Chart_DataSeries::TYPE_LINECHART) || if (($groupType == PHPExcel_Chart_DataSeries::TYPE_LINECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)) {
($groupType == PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)
) {
$objWriter->startElement('c:spPr'); $objWriter->startElement('c:spPr');
$objWriter->startElement('a:ln'); $objWriter->startElement('a:ln');
$objWriter->writeAttribute('w', 12700); $objWriter->writeAttribute('w', 12700);
@ -1221,11 +1145,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
} }
} }
if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) || if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART)) {
($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D) ||
($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART)
) {
$objWriter->startElement('c:invertIfNegative'); $objWriter->startElement('c:invertIfNegative');
$objWriter->writeAttribute('val', 0); $objWriter->writeAttribute('val', 0);
$objWriter->endElement(); $objWriter->endElement();
@ -1236,11 +1156,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
if ($plotSeriesCategory && ($plotSeriesCategory->getPointCount() > 0)) { if ($plotSeriesCategory && ($plotSeriesCategory->getPointCount() > 0)) {
$catIsMultiLevelSeries = $catIsMultiLevelSeries || $plotSeriesCategory->isMultiLevelSeries(); $catIsMultiLevelSeries = $catIsMultiLevelSeries || $plotSeriesCategory->isMultiLevelSeries();
if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) ||
($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)
) {
if (!is_null($plotGroup->getPlotStyle())) { if (!is_null($plotGroup->getPlotStyle())) {
$plotStyle = $plotGroup->getPlotStyle(); $plotStyle = $plotGroup->getPlotStyle();
if ($plotStyle) { if ($plotStyle) {
@ -1251,9 +1167,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
} }
} }
if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)) {
($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)
) {
$objWriter->startElement('c:xVal'); $objWriter->startElement('c:xVal');
} else { } else {
$objWriter->startElement('c:cat'); $objWriter->startElement('c:cat');
@ -1267,9 +1181,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
if ($plotSeriesValues) { if ($plotSeriesValues) {
$valIsMultiLevelSeries = $valIsMultiLevelSeries || $plotSeriesValues->isMultiLevelSeries(); $valIsMultiLevelSeries = $valIsMultiLevelSeries || $plotSeriesValues->isMultiLevelSeries();
if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)) {
($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)
) {
$objWriter->startElement('c:yVal'); $objWriter->startElement('c:yVal');
} else { } else {
$objWriter->startElement('c:val'); $objWriter->startElement('c:val');
@ -1284,7 +1196,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
} }
$objWriter->endElement(); $objWriter->endElement();
} }
$this->_seriesIndex += $plotSeriesIdx + 1; $this->_seriesIndex += $plotSeriesIdx + 1;
@ -1322,7 +1233,6 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->endElement(); $objWriter->endElement();
} }
$objWriter->endElement(); $objWriter->endElement();
} }
/** /**
@ -1336,12 +1246,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writePlotSeriesValues($plotSeriesValues, private function _writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', PHPExcel_Worksheet $pSheet) {
$objWriter,
$groupType,
$dataType = 'str',
PHPExcel_Worksheet $pSheet
) {
if (is_null($plotSeriesValues)) { if (is_null($plotSeriesValues)) {
return; return;
} }
@ -1391,14 +1296,8 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->startElement('c:' . $dataType . 'Cache'); $objWriter->startElement('c:' . $dataType . 'Cache');
if (($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART) && if (($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($groupType != PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && if (($plotSeriesValues->getFormatCode() !== null) && ($plotSeriesValues->getFormatCode() !== '')) {
($groupType != PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)
) {
if (($plotSeriesValues->getFormatCode() !== NULL) &&
($plotSeriesValues->getFormatCode() !== '')
) {
$objWriter->startElement('c:formatCode'); $objWriter->startElement('c:formatCode');
$objWriter->writeRawData($plotSeriesValues->getFormatCode()); $objWriter->writeRawData($plotSeriesValues->getFormatCode());
$objWriter->endElement(); $objWriter->endElement();
@ -1484,7 +1383,7 @@ class PHPExcel_Writer_Excel2007_Chart extends
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeLayout(PHPExcel_Chart_Layout $layout = NULL, $objWriter) { private function _writeLayout(PHPExcel_Chart_Layout $layout = null, $objWriter) {
$objWriter->startElement('c:layout'); $objWriter->startElement('c:layout');
if (!is_null($layout)) { if (!is_null($layout)) {
@ -1602,5 +1501,4 @@ class PHPExcel_Writer_Excel2007_Chart extends
$objWriter->endElement(); $objWriter->endElement();
} }
} }

View File

@ -43,7 +43,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeContentTypes(PHPExcel $pPHPExcel = null, $includeCharts = FALSE) public function writeContentTypes(PHPExcel $pPHPExcel = null, $includeCharts = false)
{ {
// Create XML writer // Create XML writer
$objWriter = null; $objWriter = null;
@ -61,80 +61,52 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types'); $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types');
// Theme // Theme
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/theme/theme1.xml', 'application/vnd.openxmlformats-officedocument.theme+xml');
$objWriter, '/xl/theme/theme1.xml', 'application/vnd.openxmlformats-officedocument.theme+xml'
);
// Styles // Styles
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/styles.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml');
$objWriter, '/xl/styles.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'
);
// Rels // Rels
$this->_writeDefaultContentType( $this->_writeDefaultContentType($objWriter, 'rels', 'application/vnd.openxmlformats-package.relationships+xml');
$objWriter, 'rels', 'application/vnd.openxmlformats-package.relationships+xml'
);
// XML // XML
$this->_writeDefaultContentType( $this->_writeDefaultContentType($objWriter, 'xml', 'application/xml');
$objWriter, 'xml', 'application/xml'
);
// VML // VML
$this->_writeDefaultContentType( $this->_writeDefaultContentType($objWriter, 'vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing');
$objWriter, 'vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing'
);
// Workbook // Workbook
if ($pPHPExcel->hasMacros()) { //Macros in workbook ? if ($pPHPExcel->hasMacros()) { //Macros in workbook ?
// Yes : not standard content but "macroEnabled" // Yes : not standard content but "macroEnabled"
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/workbook.xml', 'application/vnd.ms-excel.sheet.macroEnabled.main+xml');
$objWriter, '/xl/workbook.xml', 'application/vnd.ms-excel.sheet.macroEnabled.main+xml'
);
//... and define a new type for the VBA project //... and define a new type for the VBA project
$this->_writeDefaultContentType( $this->_writeDefaultContentType($objWriter, 'bin', 'application/vnd.ms-office.vbaProject');
$objWriter, 'bin', 'application/vnd.ms-office.vbaProject'
);
if ($pPHPExcel->hasMacrosCertificate()) {// signed macros ? if ($pPHPExcel->hasMacrosCertificate()) {// signed macros ?
// Yes : add needed information // Yes : add needed information
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/vbaProjectSignature.bin', 'application/vnd.ms-office.vbaProjectSignature');
$objWriter, '/xl/vbaProjectSignature.bin', 'application/vnd.ms-office.vbaProjectSignature'
);
} }
} else {// no macros in workbook, so standard type } else {// no macros in workbook, so standard type
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/workbook.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml');
$objWriter, '/xl/workbook.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml'
);
} }
// DocProps // DocProps
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml');
$objWriter, '/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml'
);
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml');
$objWriter, '/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml'
);
$customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
if (!empty($customPropertyList)) { if (!empty($customPropertyList)) {
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.custom-properties+xml');
$objWriter, '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.custom-properties+xml'
);
} }
// Worksheets // Worksheets
$sheetCount = $pPHPExcel->getSheetCount(); $sheetCount = $pPHPExcel->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) { for ($i = 0; $i < $sheetCount; ++$i) {
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/worksheets/sheet' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml');
$objWriter, '/xl/worksheets/sheet' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'
);
} }
// Shared strings // Shared strings
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/sharedStrings.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml');
$objWriter, '/xl/sharedStrings.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'
);
// Add worksheet relationship content types // Add worksheet relationship content types
$chart = 1; $chart = 1;
@ -145,17 +117,13 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
// We need a drawing relationship for the worksheet if we have either drawings or charts // We need a drawing relationship for the worksheet if we have either drawings or charts
if (($drawingCount > 0) || ($chartCount > 0)) { if (($drawingCount > 0) || ($chartCount > 0)) {
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/drawings/drawing' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.drawing+xml');
$objWriter, '/xl/drawings/drawing' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.drawing+xml'
);
} }
// If we have charts, then we need a chart relationship for every individual chart // If we have charts, then we need a chart relationship for every individual chart
if ($chartCount > 0) { if ($chartCount > 0) {
for ($c = 0; $c < $chartCount; ++$c) { for ($c = 0; $c < $chartCount; ++$c) {
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/charts/chart' . $chart++ . '.xml', 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml');
$objWriter, '/xl/charts/chart' . $chart++ . '.xml', 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'
);
} }
} }
} }
@ -163,9 +131,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
// Comments // Comments
for ($i = 0; $i < $sheetCount; ++$i) { for ($i = 0; $i < $sheetCount; ++$i) {
if (count($pPHPExcel->getSheet($i)->getComments()) > 0) { if (count($pPHPExcel->getSheet($i)->getComments()) > 0) {
$this->_writeOverrideContentType( $this->_writeOverrideContentType($objWriter, '/xl/comments' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml');
$objWriter, '/xl/comments' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'
);
} }
} }
@ -190,9 +156,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
if (!isset( $aMediaContentTypes[$extension]) ) { if (!isset( $aMediaContentTypes[$extension]) ) {
$aMediaContentTypes[$extension] = $mimeType; $aMediaContentTypes[$extension] = $mimeType;
$this->_writeDefaultContentType( $this->_writeDefaultContentType($objWriter, $extension, $mimeType);
$objWriter, $extension, $mimeType
);
} }
} }
if ($pPHPExcel->hasRibbonBinObjects()) {//Some additional objects in the ribbon ? if ($pPHPExcel->hasRibbonBinObjects()) {//Some additional objects in the ribbon ?
@ -200,9 +164,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$tabRibbonTypes=array_diff($pPHPExcel->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); $tabRibbonTypes=array_diff($pPHPExcel->getRibbonBinObjects('types'), array_keys($aMediaContentTypes));
foreach ($tabRibbonTypes as $aRibbonType) { foreach ($tabRibbonTypes as $aRibbonType) {
$mimeType='image/.'.$aRibbonType;//we wrote $mimeType like customUI Editor $mimeType='image/.'.$aRibbonType;//we wrote $mimeType like customUI Editor
$this->_writeDefaultContentType( $this->_writeDefaultContentType($objWriter, $aRibbonType, $mimeType);
$objWriter, $aRibbonType, $mimeType
);
} }
} }
$sheetCount = $pPHPExcel->getSheetCount(); $sheetCount = $pPHPExcel->getSheetCount();
@ -212,9 +174,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
if (!isset( $aMediaContentTypes[strtolower($image->getExtension())])) { if (!isset( $aMediaContentTypes[strtolower($image->getExtension())])) {
$aMediaContentTypes[strtolower($image->getExtension())] = $this->_getImageMimeType($image->getPath()); $aMediaContentTypes[strtolower($image->getExtension())] = $this->_getImageMimeType($image->getPath());
$this->_writeDefaultContentType( $this->_writeDefaultContentType($objWriter, strtolower($image->getExtension()), $aMediaContentTypes[strtolower($image->getExtension())]);
$objWriter, strtolower($image->getExtension()), $aMediaContentTypes[strtolower($image->getExtension())]
);
} }
} }
} }

View File

@ -268,5 +268,4 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
// Return // Return
return $objWriter->getData(); return $objWriter->getData();
} }
} }

View File

@ -179,7 +179,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_PATH) { $pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_PATH) {
// Gradient fill // Gradient fill
$this->_writeGradientFill($objWriter, $pFill); $this->_writeGradientFill($objWriter, $pFill);
} elseif($pFill->getFillType() !== NULL) { } elseif ($pFill->getFillType() !== null) {
// Pattern fill // Pattern fill
$this->_writePatternFill($objWriter, $pFill); $this->_writePatternFill($objWriter, $pFill);
} }
@ -285,60 +285,60 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
// Bold. We explicitly write this element also when false (like MS Office Excel 2007 does // Bold. We explicitly write this element also when false (like MS Office Excel 2007 does
// for conditional formatting). Otherwise it will apparently not be picked up in conditional // for conditional formatting). Otherwise it will apparently not be picked up in conditional
// formatting style dialog // formatting style dialog
if ($pFont->getBold() !== NULL) { if ($pFont->getBold() !== null) {
$objWriter->startElement('b'); $objWriter->startElement('b');
$objWriter->writeAttribute('val', $pFont->getBold() ? '1' : '0'); $objWriter->writeAttribute('val', $pFont->getBold() ? '1' : '0');
$objWriter->endElement(); $objWriter->endElement();
} }
// Italic // Italic
if ($pFont->getItalic() !== NULL) { if ($pFont->getItalic() !== null) {
$objWriter->startElement('i'); $objWriter->startElement('i');
$objWriter->writeAttribute('val', $pFont->getItalic() ? '1' : '0'); $objWriter->writeAttribute('val', $pFont->getItalic() ? '1' : '0');
$objWriter->endElement(); $objWriter->endElement();
} }
// Strikethrough // Strikethrough
if ($pFont->getStrikethrough() !== NULL) { if ($pFont->getStrikethrough() !== null) {
$objWriter->startElement('strike'); $objWriter->startElement('strike');
$objWriter->writeAttribute('val', $pFont->getStrikethrough() ? '1' : '0'); $objWriter->writeAttribute('val', $pFont->getStrikethrough() ? '1' : '0');
$objWriter->endElement(); $objWriter->endElement();
} }
// Underline // Underline
if ($pFont->getUnderline() !== NULL) { if ($pFont->getUnderline() !== null) {
$objWriter->startElement('u'); $objWriter->startElement('u');
$objWriter->writeAttribute('val', $pFont->getUnderline()); $objWriter->writeAttribute('val', $pFont->getUnderline());
$objWriter->endElement(); $objWriter->endElement();
} }
// Superscript / subscript // Superscript / subscript
if ($pFont->getSuperScript() === TRUE || $pFont->getSubScript() === TRUE) { if ($pFont->getSuperScript() === true || $pFont->getSubScript() === true) {
$objWriter->startElement('vertAlign'); $objWriter->startElement('vertAlign');
if ($pFont->getSuperScript() === TRUE) { if ($pFont->getSuperScript() === true) {
$objWriter->writeAttribute('val', 'superscript'); $objWriter->writeAttribute('val', 'superscript');
} else if ($pFont->getSubScript() === TRUE) { } else if ($pFont->getSubScript() === true) {
$objWriter->writeAttribute('val', 'subscript'); $objWriter->writeAttribute('val', 'subscript');
} }
$objWriter->endElement(); $objWriter->endElement();
} }
// Size // Size
if ($pFont->getSize() !== NULL) { if ($pFont->getSize() !== null) {
$objWriter->startElement('sz'); $objWriter->startElement('sz');
$objWriter->writeAttribute('val', $pFont->getSize()); $objWriter->writeAttribute('val', $pFont->getSize());
$objWriter->endElement(); $objWriter->endElement();
} }
// Foreground color // Foreground color
if ($pFont->getColor()->getARGB() !== NULL) { if ($pFont->getColor()->getARGB() !== null) {
$objWriter->startElement('color'); $objWriter->startElement('color');
$objWriter->writeAttribute('rgb', $pFont->getColor()->getARGB()); $objWriter->writeAttribute('rgb', $pFont->getColor()->getARGB());
$objWriter->endElement(); $objWriter->endElement();
} }
// Name // Name
if ($pFont->getName() !== NULL) { if ($pFont->getName() !== null) {
$objWriter->startElement('name'); $objWriter->startElement('name');
$objWriter->writeAttribute('val', $pFont->getName()); $objWriter->writeAttribute('val', $pFont->getName());
$objWriter->endElement(); $objWriter->endElement();
@ -482,14 +482,14 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
// alignment // alignment
$objWriter->startElement('alignment'); $objWriter->startElement('alignment');
if ($pStyle->getAlignment()->getHorizontal() !== NULL) { if ($pStyle->getAlignment()->getHorizontal() !== null) {
$objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal()); $objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal());
} }
if ($pStyle->getAlignment()->getVertical() !== NULL) { if ($pStyle->getAlignment()->getVertical() !== null) {
$objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical()); $objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical());
} }
if ($pStyle->getAlignment()->getTextRotation() !== NULL) { if ($pStyle->getAlignment()->getTextRotation() !== null) {
$textRotation = 0; $textRotation = 0;
if ($pStyle->getAlignment()->getTextRotation() >= 0) { if ($pStyle->getAlignment()->getTextRotation() >= 0) {
$textRotation = $pStyle->getAlignment()->getTextRotation(); $textRotation = $pStyle->getAlignment()->getTextRotation();
@ -504,16 +504,15 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$this->_writeBorder($objWriter, $pStyle->getBorders()); $this->_writeBorder($objWriter, $pStyle->getBorders());
// protection // protection
if (($pStyle->getProtection()->getLocked() !== NULL) || if (($pStyle->getProtection()->getLocked() !== null) || ($pStyle->getProtection()->getHidden() !== null)) {
($pStyle->getProtection()->getHidden() !== NULL)) {
if ($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT || if ($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT ||
$pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT) { $pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT) {
$objWriter->startElement('protection'); $objWriter->startElement('protection');
if (($pStyle->getProtection()->getLocked() !== NULL) && if (($pStyle->getProtection()->getLocked() !== null) &&
($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) { ($pStyle->getProtection()->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) {
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
} }
if (($pStyle->getProtection()->getHidden() !== NULL) && if (($pStyle->getProtection()->getHidden() !== null) &&
($pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) { ($pStyle->getProtection()->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT)) {
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
} }
@ -562,7 +561,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$formatCode = $pNumberFormat->getFormatCode(); $formatCode = $pNumberFormat->getFormatCode();
// numFmt // numFmt
if ($formatCode !== NULL) { if ($formatCode !== null) {
$objWriter->startElement('numFmt'); $objWriter->startElement('numFmt');
$objWriter->writeAttribute('numFmtId', ($pId + 164)); $objWriter->writeAttribute('numFmtId', ($pId + 164));
$objWriter->writeAttribute('formatCode', $formatCode); $objWriter->writeAttribute('formatCode', $formatCode);
@ -579,9 +578,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
*/ */
public function allStyles(PHPExcel $pPHPExcel = null) public function allStyles(PHPExcel $pPHPExcel = null)
{ {
$aStyles = $pPHPExcel->getCellXfCollection(); return $pPHPExcel->getCellXfCollection();
return $aStyles;
} }
/** /**

View File

@ -845,7 +845,6 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->writeAttribute('typeface', $typeface); $objWriter->writeAttribute('typeface', $typeface);
$objWriter->endElement(); $objWriter->endElement();
} }
} }
/** /**
@ -866,6 +865,5 @@ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement(); $objWriter->endElement();
} }
} }
} }

View File

@ -43,7 +43,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeWorkbook(PHPExcel $pPHPExcel = null, $recalcRequired = FALSE) public function writeWorkbook(PHPExcel $pPHPExcel = null, $recalcRequired = false)
{ {
// Create XML writer // Create XML writer
$objWriter = null; $objWriter = null;
@ -190,7 +190,7 @@ class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_Write
* @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null, $recalcRequired = TRUE) private function _writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null, $recalcRequired = true)
{ {
$objWriter->startElement('calcPr'); $objWriter->startElement('calcPr');

View File

@ -679,21 +679,18 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$dataSection_Content .= pack('V', $dataProp['data']['data']); $dataSection_Content .= pack('V', $dataProp['data']['data']);
$dataSection_Content_Offset += 4 + 4; $dataSection_Content_Offset += 4 + 4;
} } elseif ($dataProp['type']['data'] == 0x03) { // 4 byte signed integer
elseif ($dataProp['type']['data'] == 0x03) { // 4 byte signed integer
$dataSection_Content .= pack('V', $dataProp['data']['data']); $dataSection_Content .= pack('V', $dataProp['data']['data']);
$dataSection_Content_Offset += 4 + 4; $dataSection_Content_Offset += 4 + 4;
} } elseif ($dataProp['type']['data'] == 0x0B) { // Boolean
elseif ($dataProp['type']['data'] == 0x0B) { // Boolean
if ($dataProp['data']['data'] == false) { if ($dataProp['data']['data'] == false) {
$dataSection_Content .= pack('V', 0x0000); $dataSection_Content .= pack('V', 0x0000);
} else { } else {
$dataSection_Content .= pack('V', 0x0001); $dataSection_Content .= pack('V', 0x0001);
} }
$dataSection_Content_Offset += 4 + 4; $dataSection_Content_Offset += 4 + 4;
} } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
// Null-terminated string // Null-terminated string
$dataProp['data']['data'] .= chr(0); $dataProp['data']['data'] .= chr(0);
$dataProp['data']['length'] += 1; $dataProp['data']['length'] += 1;
@ -705,13 +702,11 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$dataSection_Content .= $dataProp['data']['data']; $dataSection_Content .= $dataProp['data']['data'];
$dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']); $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
} } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
$dataSection_Content .= $dataProp['data']['data']; $dataSection_Content .= $dataProp['data']['data'];
$dataSection_Content_Offset += 4 + 8; $dataSection_Content_Offset += 4 + 8;
} } else {
else {
// Data Type Not Used at the moment // Data Type Not Used at the moment
$dataSection_Content .= $dataProp['data']['data']; $dataSection_Content .= $dataProp['data']['data'];
@ -867,13 +862,11 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$dataSection_Content .= pack('V', $dataProp['data']['data']); $dataSection_Content .= pack('V', $dataProp['data']['data']);
$dataSection_Content_Offset += 4 + 4; $dataSection_Content_Offset += 4 + 4;
} } elseif ($dataProp['type']['data'] == 0x03) { // 4 byte signed integer
elseif ($dataProp['type']['data'] == 0x03) { // 4 byte signed integer
$dataSection_Content .= pack('V', $dataProp['data']['data']); $dataSection_Content .= pack('V', $dataProp['data']['data']);
$dataSection_Content_Offset += 4 + 4; $dataSection_Content_Offset += 4 + 4;
} } elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
elseif ($dataProp['type']['data'] == 0x1E) { // null-terminated string prepended by dword string length
// Null-terminated string // Null-terminated string
$dataProp['data']['data'] .= chr(0); $dataProp['data']['data'] .= chr(0);
$dataProp['data']['length'] += 1; $dataProp['data']['length'] += 1;
@ -885,13 +878,11 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$dataSection_Content .= $dataProp['data']['data']; $dataSection_Content .= $dataProp['data']['data'];
$dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']); $dataSection_Content_Offset += 4 + 4 + strlen($dataProp['data']['data']);
} } elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
elseif ($dataProp['type']['data'] == 0x40) { // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
$dataSection_Content .= $dataProp['data']['data']; $dataSection_Content .= $dataProp['data']['data'];
$dataSection_Content_Offset += 4 + 8; $dataSection_Content_Offset += 4 + 8;
} } else {
else {
// Data Type Not Used at the moment // Data Type Not Used at the moment
} }
} }