PSR-2 : Fixes

This commit is contained in:
Progi1984 2015-05-15 13:17:40 +02:00
parent 96f3d0e6ee
commit 5508013569
8 changed files with 371 additions and 310 deletions

View File

@ -214,7 +214,7 @@ class PHPExcel_Worksheet_PageSetup
* *
* @var boolean * @var boolean
*/ */
private $_fitToPage = FALSE; private $_fitToPage = false;
/** /**
* Fit To Height * Fit To Height
@ -251,28 +251,28 @@ class PHPExcel_Worksheet_PageSetup
* *
* @var boolean * @var boolean
*/ */
private $_horizontalCentered = FALSE; private $_horizontalCentered = false;
/** /**
* Center page vertically * Center page vertically
* *
* @var boolean * @var boolean
*/ */
private $_verticalCentered = FALSE; private $_verticalCentered = false;
/** /**
* Print area * Print area
* *
* @var string * @var string
*/ */
private $_printArea = NULL; private $_printArea = null;
/** /**
* First page number * First page number
* *
* @var int * @var int
*/ */
private $_firstPageNumber = NULL; private $_firstPageNumber = null;
/** /**
* Create a new PHPExcel_Worksheet_PageSetup * Create a new PHPExcel_Worksheet_PageSetup
@ -286,7 +286,8 @@ class PHPExcel_Worksheet_PageSetup
* *
* @return int * @return int
*/ */
public function getPaperSize() { public function getPaperSize()
{
return $this->_paperSize; return $this->_paperSize;
} }
@ -370,7 +371,7 @@ class PHPExcel_Worksheet_PageSetup
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_PageSetup * @return PHPExcel_Worksheet_PageSetup
*/ */
public function setFitToPage($pValue = TRUE) { public function setFitToPage($pValue = true) {
$this->_fitToPage = $pValue; $this->_fitToPage = $pValue;
return $this; return $this;
} }
@ -391,10 +392,10 @@ class PHPExcel_Worksheet_PageSetup
* @param boolean $pUpdate Update fitToPage so it applies rather than scaling * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
* @return PHPExcel_Worksheet_PageSetup * @return PHPExcel_Worksheet_PageSetup
*/ */
public function setFitToHeight($pValue = 1, $pUpdate = TRUE) { public function setFitToHeight($pValue = 1, $pUpdate = true) {
$this->_fitToHeight = $pValue; $this->_fitToHeight = $pValue;
if ($pUpdate) { if ($pUpdate) {
$this->_fitToPage = TRUE; $this->_fitToPage = true;
} }
return $this; return $this;
} }
@ -415,10 +416,10 @@ class PHPExcel_Worksheet_PageSetup
* @param boolean $pUpdate Update fitToPage so it applies rather than scaling * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
* @return PHPExcel_Worksheet_PageSetup * @return PHPExcel_Worksheet_PageSetup
*/ */
public function setFitToWidth($pValue = 1, $pUpdate = TRUE) { public function setFitToWidth($pValue = 1, $pUpdate = true) {
$this->_fitToWidth = $pValue; $this->_fitToWidth = $pValue;
if ($pUpdate) { if ($pUpdate) {
$this->_fitToPage = TRUE; $this->_fitToPage = true;
} }
return $this; return $this;
} }
@ -610,7 +611,7 @@ class PHPExcel_Worksheet_PageSetup
*/ */
public function clearPrintArea($index = 0) { public function clearPrintArea($index = 0) {
if ($index == 0) { if ($index == 0) {
$this->_printArea = NULL; $this->_printArea = null;
} else { } else {
$printAreas = explode(',', $this->_printArea); $printAreas = explode(',', $this->_printArea);
if (isset($printAreas[$index-1])) { if (isset($printAreas[$index-1])) {

View File

@ -166,7 +166,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function isProtectionEnabled() { function isProtectionEnabled()
{
return $this->_sheet || return $this->_sheet ||
$this->_objects || $this->_objects ||
$this->_scenarios || $this->_scenarios ||
@ -190,7 +191,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getSheet() { function getSheet()
{
return $this->_sheet; return $this->_sheet;
} }
@ -200,7 +202,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setSheet($pValue = false) { function setSheet($pValue = false)
{
$this->_sheet = $pValue; $this->_sheet = $pValue;
return $this; return $this;
} }
@ -210,7 +213,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getObjects() { function getObjects()
{
return $this->_objects; return $this->_objects;
} }
@ -220,7 +224,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setObjects($pValue = false) { function setObjects($pValue = false)
{
$this->_objects = $pValue; $this->_objects = $pValue;
return $this; return $this;
} }
@ -230,7 +235,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getScenarios() { function getScenarios()
{
return $this->_scenarios; return $this->_scenarios;
} }
@ -240,7 +246,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setScenarios($pValue = false) { function setScenarios($pValue = false)
{
$this->_scenarios = $pValue; $this->_scenarios = $pValue;
return $this; return $this;
} }
@ -250,7 +257,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getFormatCells() { function getFormatCells()
{
return $this->_formatCells; return $this->_formatCells;
} }
@ -260,7 +268,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setFormatCells($pValue = false) { function setFormatCells($pValue = false)
{
$this->_formatCells = $pValue; $this->_formatCells = $pValue;
return $this; return $this;
} }
@ -270,7 +279,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getFormatColumns() { function getFormatColumns()
{
return $this->_formatColumns; return $this->_formatColumns;
} }
@ -280,7 +290,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setFormatColumns($pValue = false) { function setFormatColumns($pValue = false)
{
$this->_formatColumns = $pValue; $this->_formatColumns = $pValue;
return $this; return $this;
} }
@ -290,7 +301,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getFormatRows() { function getFormatRows()
{
return $this->_formatRows; return $this->_formatRows;
} }
@ -300,7 +312,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setFormatRows($pValue = false) { function setFormatRows($pValue = false)
{
$this->_formatRows = $pValue; $this->_formatRows = $pValue;
return $this; return $this;
} }
@ -310,7 +323,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getInsertColumns() { function getInsertColumns()
{
return $this->_insertColumns; return $this->_insertColumns;
} }
@ -320,7 +334,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setInsertColumns($pValue = false) { function setInsertColumns($pValue = false)
{
$this->_insertColumns = $pValue; $this->_insertColumns = $pValue;
return $this; return $this;
} }
@ -330,7 +345,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getInsertRows() { function getInsertRows()
{
return $this->_insertRows; return $this->_insertRows;
} }
@ -340,7 +356,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setInsertRows($pValue = false) { function setInsertRows($pValue = false)
{
$this->_insertRows = $pValue; $this->_insertRows = $pValue;
return $this; return $this;
} }
@ -350,7 +367,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getInsertHyperlinks() { function getInsertHyperlinks()
{
return $this->_insertHyperlinks; return $this->_insertHyperlinks;
} }
@ -360,7 +378,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setInsertHyperlinks($pValue = false) { function setInsertHyperlinks($pValue = false)
{
$this->_insertHyperlinks = $pValue; $this->_insertHyperlinks = $pValue;
return $this; return $this;
} }
@ -370,7 +389,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getDeleteColumns() { function getDeleteColumns()
{
return $this->_deleteColumns; return $this->_deleteColumns;
} }
@ -380,7 +400,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setDeleteColumns($pValue = false) { function setDeleteColumns($pValue = false)
{
$this->_deleteColumns = $pValue; $this->_deleteColumns = $pValue;
return $this; return $this;
} }
@ -390,7 +411,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getDeleteRows() { function getDeleteRows()
{
return $this->_deleteRows; return $this->_deleteRows;
} }
@ -400,7 +422,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setDeleteRows($pValue = false) { function setDeleteRows($pValue = false)
{
$this->_deleteRows = $pValue; $this->_deleteRows = $pValue;
return $this; return $this;
} }
@ -410,7 +433,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getSelectLockedCells() { function getSelectLockedCells()
{
return $this->_selectLockedCells; return $this->_selectLockedCells;
} }
@ -420,7 +444,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setSelectLockedCells($pValue = false) { function setSelectLockedCells($pValue = false)
{
$this->_selectLockedCells = $pValue; $this->_selectLockedCells = $pValue;
return $this; return $this;
} }
@ -430,7 +455,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getSort() { function getSort()
{
return $this->_sort; return $this->_sort;
} }
@ -440,7 +466,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setSort($pValue = false) { function setSort($pValue = false)
{
$this->_sort = $pValue; $this->_sort = $pValue;
return $this; return $this;
} }
@ -450,7 +477,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getAutoFilter() { function getAutoFilter()
{
return $this->_autoFilter; return $this->_autoFilter;
} }
@ -460,7 +488,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setAutoFilter($pValue = false) { function setAutoFilter($pValue = false)
{
$this->_autoFilter = $pValue; $this->_autoFilter = $pValue;
return $this; return $this;
} }
@ -470,7 +499,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getPivotTables() { function getPivotTables()
{
return $this->_pivotTables; return $this->_pivotTables;
} }
@ -480,7 +510,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setPivotTables($pValue = false) { function setPivotTables($pValue = false)
{
$this->_pivotTables = $pValue; $this->_pivotTables = $pValue;
return $this; return $this;
} }
@ -490,7 +521,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return boolean * @return boolean
*/ */
function getSelectUnlockedCells() { function getSelectUnlockedCells()
{
return $this->_selectUnlockedCells; return $this->_selectUnlockedCells;
} }
@ -500,7 +532,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setSelectUnlockedCells($pValue = false) { function setSelectUnlockedCells($pValue = false)
{
$this->_selectUnlockedCells = $pValue; $this->_selectUnlockedCells = $pValue;
return $this; return $this;
} }
@ -510,7 +543,8 @@ class PHPExcel_Worksheet_Protection
* *
* @return string * @return string
*/ */
function getPassword() { function getPassword()
{
return $this->_password; return $this->_password;
} }
@ -521,7 +555,8 @@ class PHPExcel_Worksheet_Protection
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
* @return PHPExcel_Worksheet_Protection * @return PHPExcel_Worksheet_Protection
*/ */
function setPassword($pValue = '', $pAlreadyHashed = false) { function setPassword($pValue = '', $pAlreadyHashed = false)
{
if (!$pAlreadyHashed) { if (!$pAlreadyHashed) {
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
} }
@ -532,7 +567,8 @@ class PHPExcel_Worksheet_Protection
/** /**
* Implement PHP __clone to create a deep clone, not just a shallow copy. * Implement PHP __clone to create a deep clone, not just a shallow copy.
*/ */
public function __clone() { public function __clone()
{
$vars = get_object_vars($this); $vars = get_object_vars($this);
foreach ($vars as $key => $value) { foreach ($vars as $key => $value) {
if (is_object($value)) { if (is_object($value)) {

View File

@ -65,7 +65,8 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
* *
* @return boolean * @return boolean
*/ */
public function getIncludeCharts() { public function getIncludeCharts()
{
return $this->_includeCharts; return $this->_includeCharts;
} }
@ -93,7 +94,8 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
* *
* @return boolean * @return boolean
*/ */
public function getPreCalculateFormulas() { public function getPreCalculateFormulas()
{
return $this->_preCalculateFormulas; return $this->_preCalculateFormulas;
} }
@ -105,7 +107,8 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
* @param boolean $pValue Pre-Calculate Formulas? * @param boolean $pValue Pre-Calculate Formulas?
* @return PHPExcel_Writer_IWriter * @return PHPExcel_Writer_IWriter
*/ */
public function setPreCalculateFormulas($pValue = TRUE) { public function setPreCalculateFormulas($pValue = true)
{
$this->_preCalculateFormulas = (boolean) $pValue; $this->_preCalculateFormulas = (boolean) $pValue;
return $this; return $this;
} }
@ -115,7 +118,8 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
* *
* @return boolean * @return boolean
*/ */
public function getUseDiskCaching() { public function getUseDiskCaching()
{
return $this->_useDiskCaching; return $this->_useDiskCaching;
} }
@ -127,10 +131,11 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
* @throws PHPExcel_Writer_Exception when directory does not exist * @throws PHPExcel_Writer_Exception when directory does not exist
* @return PHPExcel_Writer_Excel2007 * @return PHPExcel_Writer_Excel2007
*/ */
public function setUseDiskCaching($pValue = FALSE, $pDirectory = NULL) { public function setUseDiskCaching($pValue = false, $pDirectory = null)
{
$this->_useDiskCaching = $pValue; $this->_useDiskCaching = $pValue;
if ($pDirectory !== NULL) { if ($pDirectory !== null) {
if (is_dir($pDirectory)) { if (is_dir($pDirectory)) {
$this->_diskCachingDirectory = $pDirectory; $this->_diskCachingDirectory = $pDirectory;
} else { } else {
@ -145,7 +150,8 @@ abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
* *
* @return string * @return string
*/ */
public function getDiskCachingDirectory() { public function getDiskCachingDirectory()
{
return $this->_diskCachingDirectory; return $this->_diskCachingDirectory;
} }
} }

View File

@ -257,7 +257,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
if ($this->_spreadSheet->hasRibbonBinObjects()) { if ($this->_spreadSheet->hasRibbonBinObjects()) {
$tmpRootPath=dirname($tmpRibbonTarget).'/'; $tmpRootPath=dirname($tmpRibbonTarget).'/';
$ribbonBinObjects=$this->_spreadSheet->getRibbonBinObjects('data');//the files to write $ribbonBinObjects=$this->_spreadSheet->getRibbonBinObjects('data');//the files to write
foreach ($ribbonBinObjects as $aPath=>$aContent) { foreach ($ribbonBinObjects as $aPath => $aContent) {
$objZip->addFromString($tmpRootPath.$aPath, $aContent); $objZip->addFromString($tmpRootPath.$aPath, $aContent);
} }
//the rels for files //the rels for files

View File

@ -32,7 +32,8 @@
* @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 PHPExcel_Writer_Excel2007_WriterPart { class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPart
{
/** /**
* Write charts to XML format * Write charts to XML format
* *
@ -41,7 +42,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* @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()->getUseDiskCaching()) { if ($this->getParentWriter()->getUseDiskCaching()) {
@ -115,7 +117,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @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;
} }
@ -159,7 +162,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @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;
} }
@ -213,7 +217,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
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 ) 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)
{ {
if (is_null($plotArea)) { if (is_null($plotArea)) {
return; return;
@ -349,7 +353,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeDataLbls($objWriter, $chartLayout) { private function _writeDataLbls($objWriter, $chartLayout)
{
$objWriter->startElement('c:dLbls'); $objWriter->startElement('c:dLbls');
$objWriter->startElement('c:showLegendKey'); $objWriter->startElement('c:showLegendKey');
@ -403,7 +408,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeCatAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis) { private function _writeCatAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis)
{
$objWriter->startElement('c:catAx'); $objWriter->startElement('c:catAx');
if ($id1 > 0) { if ($id1 > 0) {
@ -524,7 +530,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeValAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines) { private function _writeValAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines)
{
$objWriter->startElement('c:valAx'); $objWriter->startElement('c:valAx');
if ($id2 > 0) { if ($id2 > 0) {
@ -1004,7 +1011,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* @return string|array * @return string|array
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private static function _getChartType($plotArea) { private static function _getChartType($plotArea)
{
$groupCount = $plotArea->getPlotGroupCount(); $groupCount = $plotArea->getPlotGroupCount();
if ($groupCount == 1) { if ($groupCount == 1) {
@ -1036,7 +1044,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, PHPExcel_Worksheet $pSheet ) { private function _writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, PHPExcel_Worksheet $pSheet)
{
if (is_null($plotGroup)) { if (is_null($plotGroup)) {
return; return;
} }
@ -1209,7 +1218,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writePlotSeriesLabel($plotSeriesLabel, $objWriter) { private function _writePlotSeriesLabel($plotSeriesLabel, $objWriter)
{
if (is_null($plotSeriesLabel)) { if (is_null($plotSeriesLabel)) {
return; return;
} }
@ -1246,7 +1256,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', PHPExcel_Worksheet $pSheet) { private function _writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', PHPExcel_Worksheet $pSheet)
{
if (is_null($plotSeriesValues)) { if (is_null($plotSeriesValues)) {
return; return;
} }
@ -1337,7 +1348,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet) { private function _writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet)
{
if (is_null($plotSeriesValues)) { if (is_null($plotSeriesValues)) {
return; return;
} }
@ -1383,7 +1395,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @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)) {
@ -1451,7 +1464,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeAlternateContent($objWriter) { private function _writeAlternateContent($objWriter)
{
$objWriter->startElement('mc:AlternateContent'); $objWriter->startElement('mc:AlternateContent');
$objWriter->writeAttribute('xmlns:mc', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); $objWriter->writeAttribute('xmlns:mc', 'http://schemas.openxmlformats.org/markup-compatibility/2006');
@ -1480,7 +1494,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
* *
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writePrintSettings($objWriter) { private function _writePrintSettings($objWriter)
{
$objWriter->startElement('c:printSettings'); $objWriter->startElement('c:printSettings');
$objWriter->startElement('c:headerFooter'); $objWriter->startElement('c:headerFooter');

View File

@ -144,7 +144,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) { if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) {
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension());
$mimeType = $this->_getImageMimeType( $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath() ); $mimeType = $this->_getImageMimeType( $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath());
} else if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) { } else if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) {
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType()); $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType());
$extension = explode('/', $extension); $extension = explode('/', $extension);
@ -153,14 +153,15 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$mimeType = $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType(); $mimeType = $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType();
} }
if (!isset( $aMediaContentTypes[$extension]) ) { if (!isset( $aMediaContentTypes[$extension])) {
$aMediaContentTypes[$extension] = $mimeType; $aMediaContentTypes[$extension] = $mimeType;
$this->_writeDefaultContentType($objWriter, $extension, $mimeType); $this->_writeDefaultContentType($objWriter, $extension, $mimeType);
} }
} }
if ($pPHPExcel->hasRibbonBinObjects()) {//Some additional objects in the ribbon ? if ($pPHPExcel->hasRibbonBinObjects()) {
//we need to write "Extension" but not already write for media content // Some additional objects in the ribbon ?
// we need to write "Extension" but not already write for media content
$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

View File

@ -760,7 +760,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
$range = PHPExcel_Cell::splitRange($autoFilterRange); $range = PHPExcel_Cell::splitRange($autoFilterRange);
$range = $range[0]; $range = $range[0];
// Strip any worksheet ref // Strip any worksheet ref
if (strpos($range[0],'!') !== false) { if (strpos($range[0], '!') !== false) {
list($ws, $range[0]) = explode('!', $range[0]); list($ws, $range[0]) = explode('!', $range[0]);
} }
$range = implode(':', $range); $range = implode(':', $range);
@ -812,7 +812,9 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
if ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP) { if ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP) {
// Date Group filters // Date Group filters
foreach ($rule->getValue() as $key => $value) { foreach ($rule->getValue() as $key => $value) {
if ($value > '') $objWriter->writeAttribute($key, $value); if ($value > '') {
$objWriter->writeAttribute($key, $value);
}
} }
$objWriter->writeAttribute('dateTimeGrouping', $rule->getGrouping()); $objWriter->writeAttribute('dateTimeGrouping', $rule->getGrouping());
} else { } else {