Merge branch 'psr2' into develop

This commit is contained in:
MarkBaker 2015-05-14 23:51:30 +01:00
commit 1c26425915
80 changed files with 5464 additions and 5419 deletions

File diff suppressed because it is too large Load Diff

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

@ -179,8 +179,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null) public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null)
{ {
$this->_axis_options['axis_labels'] = (string) $axis_labels; $this->_axis_options['axis_labels'] = (string) $axis_labels;
($horizontal_crosses_value !== null) ($horizontal_crosses_value !== null) ? $this->_axis_options['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
? $this->_axis_options['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
($horizontal_crosses !== null) ? $this->_axis_options['horizontal_crosses'] = (string) $horizontal_crosses : null; ($horizontal_crosses !== null) ? $this->_axis_options['horizontal_crosses'] = (string) $horizontal_crosses : null;
($axis_orientation !== null) ? $this->_axis_options['orientation'] = (string) $axis_orientation : null; ($axis_orientation !== null) ? $this->_axis_options['orientation'] = (string) $axis_orientation : null;
($major_tmt !== null) ? $this->_axis_options['major_tick_mark'] = (string) $major_tmt : null; ($major_tmt !== null) ? $this->_axis_options['major_tick_mark'] = (string) $major_tmt : null;
@ -279,22 +278,16 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param string $end_arrow_size * @param string $end_arrow_size
* *
*/ */
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) { public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) {
(!is_null($line_width)) ? $this->_line_style_properties['width'] = $this->getExcelPointsWidth((float) $line_width) (!is_null($line_width)) ? $this->_line_style_properties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;
: null;
(!is_null($compound_type)) ? $this->_line_style_properties['compound'] = (string) $compound_type : null; (!is_null($compound_type)) ? $this->_line_style_properties['compound'] = (string) $compound_type : null;
(!is_null($dash_type)) ? $this->_line_style_properties['dash'] = (string) $dash_type : null; (!is_null($dash_type)) ? $this->_line_style_properties['dash'] = (string) $dash_type : null;
(!is_null($cap_type)) ? $this->_line_style_properties['cap'] = (string) $cap_type : null; (!is_null($cap_type)) ? $this->_line_style_properties['cap'] = (string) $cap_type : null;
(!is_null($join_type)) ? $this->_line_style_properties['join'] = (string) $join_type : null; (!is_null($join_type)) ? $this->_line_style_properties['join'] = (string) $join_type : null;
(!is_null($head_arrow_type)) ? $this->_line_style_properties['arrow']['head']['type'] = (string) $head_arrow_type (!is_null($head_arrow_type)) ? $this->_line_style_properties['arrow']['head']['type'] = (string) $head_arrow_type : null;
: null; (!is_null($head_arrow_size)) ? $this->_line_style_properties['arrow']['head']['size'] = (string) $head_arrow_size : null;
(!is_null($head_arrow_size)) ? $this->_line_style_properties['arrow']['head']['size'] = (string) $head_arrow_size (!is_null($end_arrow_type)) ? $this->_line_style_properties['arrow']['end']['type'] = (string) $end_arrow_type : null;
: null; (!is_null($end_arrow_size)) ? $this->_line_style_properties['arrow']['end']['size'] = (string) $end_arrow_size : null;
(!is_null($end_arrow_type)) ? $this->_line_style_properties['arrow']['end']['type'] = (string) $end_arrow_type
: null;
(!is_null($end_arrow_size)) ? $this->_line_style_properties['arrow']['end']['size'] = (string) $end_arrow_size
: null;
} }
/** /**
@ -304,7 +297,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return string * @return string
*/ */
public function getLineStyleProperty($elements) public function getLineStyleProperty($elements)
{ {
return $this->getArrayElementsValue($this->_line_style_properties, $elements); return $this->getArrayElementsValue($this->_line_style_properties, $elements);
@ -317,7 +309,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return string * @return string
*/ */
public function getLineStyleArrowWidth($arrow) public function getLineStyleArrowWidth($arrow)
{ {
return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'w'); return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'w');
@ -330,7 +321,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return string * @return string
*/ */
public function getLineStyleArrowLength($arrow) public function getLineStyleArrowLength($arrow)
{ {
return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'len'); return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'len');
@ -348,10 +338,8 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param float $sh_distance * @param float $sh_distance
* *
*/ */
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) { public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) {
$this $this->_setShadowPresetsProperties((int) $sh_presets)
->_setShadowPresetsProperties((int) $sh_presets)
->_setShadowColor( ->_setShadowColor(
is_null($sh_color_value) ? $this->_shadow_properties['color']['value'] : $sh_color_value is_null($sh_color_value) ? $this->_shadow_properties['color']['value'] : $sh_color_value
, is_null($sh_color_alpha) ? (int) $this->_shadow_properties['color']['alpha'] : $sh_color_alpha , is_null($sh_color_alpha) ? (int) $this->_shadow_properties['color']['alpha'] : $sh_color_alpha
@ -368,7 +356,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setShadowPresetsProperties($shadow_presets) { private function _setShadowPresetsProperties($shadow_presets) {
$this->_shadow_properties['presets'] = $shadow_presets; $this->_shadow_properties['presets'] = $shadow_presets;
$this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
@ -384,7 +371,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setShadowProperiesMapValues(array $properties_map, &$reference = null) { private function _setShadowProperiesMapValues(array $properties_map, &$reference = null) {
$base_reference = $reference; $base_reference = $reference;
foreach ($properties_map as $property_key => $property_val) { foreach ($properties_map as $property_key => $property_val) {
@ -416,7 +402,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setShadowColor($color, $alpha, $type) { private function _setShadowColor($color, $alpha, $type) {
$this->_shadow_properties['color'] = $this->setColorProperties($color, $alpha, $type); $this->_shadow_properties['color'] = $this->setColorProperties($color, $alpha, $type);
@ -430,7 +415,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setShadowBlur($blur) { private function _setShadowBlur($blur) {
if ($blur !== null) { if ($blur !== null) {
$this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur); $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur);
@ -446,7 +430,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setShadowAngle($angle) { private function _setShadowAngle($angle) {
if ($angle !== null) { if ($angle !== null) {
$this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle); $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle);
@ -462,7 +445,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setShadowDistance($distance) { private function _setShadowDistance($distance) {
if ($distance !== null) { if ($distance !== null) {
$this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance); $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance);
@ -479,7 +461,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param int $color_alpha * @param int $color_alpha
* @param string $color_type * @param string $color_type
*/ */
public function getShadowProperty($elements) { public function getShadowProperty($elements) {
return $this->getArrayElementsValue($this->_shadow_properties, $elements); return $this->getArrayElementsValue($this->_shadow_properties, $elements);
} }
@ -492,14 +473,13 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param int $color_alpha * @param int $color_alpha
* @param string $color_type * @param string $color_type
*/ */
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) { public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) {
$this $this->_setGlowSize($size)
->_setGlowSize($size)
->_setGlowColor( ->_setGlowColor(
is_null($color_value) ? $this->_glow_properties['color']['value'] : $color_value is_null($color_value) ? $this->_glow_properties['color']['value'] : $color_value
, is_null($color_alpha) ? (int) $this->_glow_properties['color']['alpha'] : $color_alpha , is_null($color_alpha) ? (int) $this->_glow_properties['color']['alpha'] : $color_alpha
, is_null($color_type) ? $this->_glow_properties['color']['type'] : $color_type); , is_null($color_type) ? $this->_glow_properties['color']['type'] : $color_type
);
} }
/** /**
@ -509,7 +489,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return string * @return string
*/ */
public function getGlowProperty($property) { public function getGlowProperty($property) {
return $this->getArrayElementsValue($this->_glow_properties, $property); return $this->getArrayElementsValue($this->_glow_properties, $property);
} }
@ -521,7 +500,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setGlowSize($size) { private function _setGlowSize($size) {
if (!is_null($size)) { if (!is_null($size)) {
$this->_glow_properties['size'] = $this->getExcelPointsWidth($size); $this->_glow_properties['size'] = $this->getExcelPointsWidth($size);
@ -539,7 +517,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return PHPExcel_Chart_Axis * @return PHPExcel_Chart_Axis
*/ */
private function _setGlowColor($color, $alpha, $type) { private function _setGlowColor($color, $alpha, $type) {
$this->_glow_properties['color'] = $this->setColorProperties($color, $alpha, $type); $this->_glow_properties['color'] = $this->setColorProperties($color, $alpha, $type);
@ -551,7 +528,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @param float $size * @param float $size
*/ */
public function setSoftEdges($size) { public function setSoftEdges($size) {
if (!is_null($size)) { if (!is_null($size)) {
$_soft_edges['size'] = (string) $this->getExcelPointsWidth($size); $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size);
@ -563,7 +539,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* *
* @return string * @return string
*/ */
public function getSoftEdgesSize() { public function getSoftEdgesSize() {
return $this->_soft_edges['size']; return $this->_soft_edges['size'];
} }

View File

@ -387,5 +387,4 @@ class PHPExcel_Chart_DataSeries
} }
} }
} }
} }

View File

@ -96,7 +96,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return string * @return string
*/ */
public function getDataType() { public function getDataType()
{
return $this->_dataType; return $this->_dataType;
} }
@ -111,7 +112,8 @@ class PHPExcel_Chart_DataSeriesValues
* Normally used for chart data values * Normally used for chart data values
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER) { public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER)
{
if (!in_array($dataType, self::$_dataTypeValues)) { if (!in_array($dataType, self::$_dataTypeValues)) {
throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values'); throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values');
} }
@ -125,7 +127,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return string * @return string
*/ */
public function getDataSource() { public function getDataSource()
{
return $this->_dataSource; return $this->_dataSource;
} }
@ -135,7 +138,8 @@ class PHPExcel_Chart_DataSeriesValues
* @param string $dataSource * @param string $dataSource
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function setDataSource($dataSource = null, $refreshDataValues = true) { public function setDataSource($dataSource = null, $refreshDataValues = true)
{
$this->_dataSource = $dataSource; $this->_dataSource = $dataSource;
if ($refreshDataValues) { if ($refreshDataValues) {
@ -150,7 +154,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return string * @return string
*/ */
public function getPointMarker() { public function getPointMarker()
{
return $this->_marker; return $this->_marker;
} }
@ -160,7 +165,8 @@ class PHPExcel_Chart_DataSeriesValues
* @param string $marker * @param string $marker
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function setPointMarker($marker = null) { public function setPointMarker($marker = null)
{
$this->_marker = $marker; $this->_marker = $marker;
return $this; return $this;
@ -171,7 +177,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return string * @return string
*/ */
public function getFormatCode() { public function getFormatCode()
{
return $this->_formatCode; return $this->_formatCode;
} }
@ -181,7 +188,8 @@ class PHPExcel_Chart_DataSeriesValues
* @param string $formatCode * @param string $formatCode
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function setFormatCode($formatCode = null) { public function setFormatCode($formatCode = null)
{
$this->_formatCode = $formatCode; $this->_formatCode = $formatCode;
return $this; return $this;
@ -192,7 +200,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return integer * @return integer
*/ */
public function getPointCount() { public function getPointCount()
{
return $this->_pointCount; return $this->_pointCount;
} }
@ -201,7 +210,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return boolean * @return boolean
*/ */
public function isMultiLevelSeries() { public function isMultiLevelSeries()
{
if (count($this->_dataValues) > 0) { if (count($this->_dataValues) > 0) {
return is_array($this->_dataValues[0]); return is_array($this->_dataValues[0]);
} }
@ -213,7 +223,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return boolean * @return boolean
*/ */
public function multiLevelCount() { public function multiLevelCount()
{
$levelCount = 0; $levelCount = 0;
foreach ($this->_dataValues as $dataValueSet) { foreach ($this->_dataValues as $dataValueSet) {
$levelCount = max($levelCount,count($dataValueSet)); $levelCount = max($levelCount,count($dataValueSet));
@ -226,7 +237,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return array of mixed * @return array of mixed
*/ */
public function getDataValues() { public function getDataValues()
{
return $this->_dataValues; return $this->_dataValues;
} }
@ -235,7 +247,8 @@ class PHPExcel_Chart_DataSeriesValues
* *
* @return mixed * @return mixed
*/ */
public function getDataValue() { public function getDataValue()
{
$count = count($this->_dataValues); $count = count($this->_dataValues);
if ($count == 0) { if ($count == 0) {
return null; return null;
@ -254,7 +267,8 @@ class PHPExcel_Chart_DataSeriesValues
* FALSE - don't change the value of _dataSource * FALSE - don't change the value of _dataSource
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function setDataValues($dataValues = array(), $refreshDataSource = TRUE) { public function setDataValues($dataValues = array(), $refreshDataSource = true)
{
$this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues); $this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues);
$this->_pointCount = count($dataValues); $this->_pointCount = count($dataValues);
@ -265,17 +279,19 @@ class PHPExcel_Chart_DataSeriesValues
return $this; return $this;
} }
private function _stripNulls($var) { private function _stripNulls($var)
return $var !== NULL; {
return $var !== null;
} }
public function refresh(PHPExcel_Worksheet $worksheet, $flatten = TRUE) { public function refresh(PHPExcel_Worksheet $worksheet, $flatten = true)
if ($this->_dataSource !== NULL) { {
if ($this->_dataSource !== null) {
$calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent()); $calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent());
$newDataValues = PHPExcel_Calculation::_unwrapResult( $newDataValues = PHPExcel_Calculation::_unwrapResult(
$calcEngine->_calculateFormulaValue( $calcEngine->_calculateFormulaValue(
'='.$this->_dataSource, '='.$this->_dataSource,
NULL, null,
$worksheet->getCell('A1') $worksheet->getCell('A1')
) )
); );
@ -313,7 +329,5 @@ class PHPExcel_Chart_DataSeriesValues
} }
$this->_pointCount = count($this->_dataValues); $this->_pointCount = count($this->_dataValues);
} }
} }
} }

View File

@ -7,8 +7,8 @@
* Time: 2:36 PM * Time: 2:36 PM
*/ */
class PHPExcel_Chart_GridLines extends class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
PHPExcel_Chart_Properties { {
/** /**
* Properties of Class: * Properties of Class:
@ -20,12 +20,12 @@ class PHPExcel_Chart_GridLines extends
* *
*/ */
private private $_object_state = false;
$_object_state = FALSE,
$_line_properties = array( private $_line_properties = array(
'color' => array( 'color' => array(
'type' => self::EXCEL_COLOR_TYPE_STANDARD, 'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => NULL, 'value' => null,
'alpha' => 0 'alpha' => 0
), ),
'style' => array( 'style' => array(
@ -45,36 +45,39 @@ class PHPExcel_Chart_GridLines extends
), ),
) )
) )
), );
$_shadow_properties = array(
private $_shadow_properties = array(
'presets' => self::SHADOW_PRESETS_NOSHADOW, 'presets' => self::SHADOW_PRESETS_NOSHADOW,
'effect' => NULL, 'effect' => null,
'color' => array( 'color' => array(
'type' => self::EXCEL_COLOR_TYPE_STANDARD, 'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => 'black', 'value' => 'black',
'alpha' => 85, 'alpha' => 85,
), ),
'size' => array( 'size' => array(
'sx' => NULL, 'sx' => null,
'sy' => NULL, 'sy' => null,
'kx' => NULL 'kx' => null
), ),
'blur' => NULL, 'blur' => null,
'direction' => NULL, 'direction' => null,
'distance' => NULL, 'distance' => null,
'algn' => NULL, 'algn' => null,
'rotWithShape' => NULL 'rotWithShape' => null
), );
$_glow_properties = array(
'size' => NULL, private $_glow_properties = array(
'size' => null,
'color' => array( 'color' => array(
'type' => self::EXCEL_COLOR_TYPE_STANDARD, 'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => 'black', 'value' => 'black',
'alpha' => 40 'alpha' => 40
) )
), );
$_soft_edges = array(
'size' => NULL private $_soft_edges = array(
'size' => null
); );
/** /**
@ -83,7 +86,8 @@ class PHPExcel_Chart_GridLines extends
* @return bool * @return bool
*/ */
public function getObjectState() { public function getObjectState()
{
return $this->_object_state; return $this->_object_state;
} }
@ -93,8 +97,9 @@ class PHPExcel_Chart_GridLines extends
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _activateObject() { private function _activateObject()
$this->_object_state = TRUE; {
$this->_object_state = true;
return $this; return $this;
} }
@ -107,7 +112,8 @@ class PHPExcel_Chart_GridLines extends
* @param string $type * @param string $type
*/ */
public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD) { public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD)
{
$this $this
->_activateObject() ->_activateObject()
->_line_properties['color'] = $this->setColorProperties( ->_line_properties['color'] = $this->setColorProperties(
@ -130,35 +136,36 @@ class PHPExcel_Chart_GridLines extends
* @param string $end_arrow_size * @param string $end_arrow_size
*/ */
public function setLineStyleProperties($line_width = NULL, $compound_type = NULL, $dash_type = NULL, $cap_type = NULL, $join_type = NULL, $head_arrow_type = NULL, $head_arrow_size = NULL, $end_arrow_type = NULL, $end_arrow_size = NULL) { public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)
{
$this->_activateObject(); $this->_activateObject();
(!is_null($line_width)) (!is_null($line_width))
? $this->_line_properties['style']['width'] = $this->getExcelPointsWidth((float) $line_width) ? $this->_line_properties['style']['width'] = $this->getExcelPointsWidth((float) $line_width)
: NULL; : null;
(!is_null($compound_type)) (!is_null($compound_type))
? $this->_line_properties['style']['compound'] = (string) $compound_type ? $this->_line_properties['style']['compound'] = (string) $compound_type
: NULL; : null;
(!is_null($dash_type)) (!is_null($dash_type))
? $this->_line_properties['style']['dash'] = (string) $dash_type ? $this->_line_properties['style']['dash'] = (string) $dash_type
: NULL; : null;
(!is_null($cap_type)) (!is_null($cap_type))
? $this->_line_properties['style']['cap'] = (string) $cap_type ? $this->_line_properties['style']['cap'] = (string) $cap_type
: NULL; : null;
(!is_null($join_type)) (!is_null($join_type))
? $this->_line_properties['style']['join'] = (string) $join_type ? $this->_line_properties['style']['join'] = (string) $join_type
: NULL; : null;
(!is_null($head_arrow_type)) (!is_null($head_arrow_type))
? $this->_line_properties['style']['arrow']['head']['type'] = (string) $head_arrow_type ? $this->_line_properties['style']['arrow']['head']['type'] = (string) $head_arrow_type
: NULL; : null;
(!is_null($head_arrow_size)) (!is_null($head_arrow_size))
? $this->_line_properties['style']['arrow']['head']['size'] = (string) $head_arrow_size ? $this->_line_properties['style']['arrow']['head']['size'] = (string) $head_arrow_size
: NULL; : null;
(!is_null($end_arrow_type)) (!is_null($end_arrow_type))
? $this->_line_properties['style']['arrow']['end']['type'] = (string) $end_arrow_type ? $this->_line_properties['style']['arrow']['end']['type'] = (string) $end_arrow_type
: NULL; : null;
(!is_null($end_arrow_size)) (!is_null($end_arrow_size))
? $this->_line_properties['style']['arrow']['end']['size'] = (string) $end_arrow_size ? $this->_line_properties['style']['arrow']['end']['size'] = (string) $end_arrow_size
: NULL; : null;
} }
/** /**
@ -169,7 +176,8 @@ class PHPExcel_Chart_GridLines extends
* @return string * @return string
*/ */
public function getLineColorProperty($parameter) { public function getLineColorProperty($parameter)
{
return $this->_line_properties['color'][$parameter]; return $this->_line_properties['color'][$parameter];
} }
@ -181,7 +189,8 @@ class PHPExcel_Chart_GridLines extends
* @return string * @return string
*/ */
public function getLineStyleProperty($elements) { public function getLineStyleProperty($elements)
{
return $this->getArrayElementsValue($this->_line_properties['style'], $elements); return $this->getArrayElementsValue($this->_line_properties['style'], $elements);
} }
@ -195,7 +204,8 @@ class PHPExcel_Chart_GridLines extends
* *
*/ */
public function setGlowProperties($size, $color_value = NULL, $color_alpha = NULL, $color_type = NULL) { public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null)
{
$this $this
->_activateObject() ->_activateObject()
->_setGlowSize($size) ->_setGlowSize($size)
@ -210,7 +220,8 @@ class PHPExcel_Chart_GridLines extends
* @return string * @return string
*/ */
public function getGlowColor($property) { public function getGlowColor($property)
{
return $this->_glow_properties['color'][$property]; return $this->_glow_properties['color'][$property];
} }
@ -220,7 +231,8 @@ class PHPExcel_Chart_GridLines extends
* @return string * @return string
*/ */
public function getGlowSize() { public function getGlowSize()
{
return $this->_glow_properties['size']; return $this->_glow_properties['size'];
} }
@ -232,7 +244,8 @@ class PHPExcel_Chart_GridLines extends
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setGlowSize($size) { private function _setGlowSize($size)
{
$this->_glow_properties['size'] = $this->getExcelPointsWidth((float) $size); $this->_glow_properties['size'] = $this->getExcelPointsWidth((float) $size);
return $this; return $this;
@ -248,7 +261,8 @@ class PHPExcel_Chart_GridLines extends
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setGlowColor($color, $alpha, $type) { private function _setGlowColor($color, $alpha, $type)
{
if (!is_null($color)) { if (!is_null($color)) {
$this->_glow_properties['color']['value'] = (string) $color; $this->_glow_properties['color']['value'] = (string) $color;
} }
@ -271,7 +285,8 @@ class PHPExcel_Chart_GridLines extends
* @return string * @return string
*/ */
public function getLineStyleArrowParameters($arrow_selector, $property_selector) { public function getLineStyleArrowParameters($arrow_selector, $property_selector)
{
return $this->getLineStyleArrowSize($this->_line_properties['style']['arrow'][$arrow_selector]['size'], $property_selector); return $this->getLineStyleArrowSize($this->_line_properties['style']['arrow'][$arrow_selector]['size'], $property_selector);
} }
@ -288,7 +303,8 @@ class PHPExcel_Chart_GridLines extends
* *
*/ */
public function setShadowProperties($sh_presets, $sh_color_value = NULL, $sh_color_type = NULL, $sh_color_alpha = NULL, $sh_blur = NULL, $sh_angle = NULL, $sh_distance = NULL) { public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null)
{
$this $this
->_activateObject() ->_activateObject()
->_setShadowPresetsProperties((int) $sh_presets) ->_setShadowPresetsProperties((int) $sh_presets)
@ -310,7 +326,8 @@ class PHPExcel_Chart_GridLines extends
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setShadowPresetsProperties($shadow_presets) { private function _setShadowPresetsProperties($shadow_presets)
{
$this->_shadow_properties['presets'] = $shadow_presets; $this->_shadow_properties['presets'] = $shadow_presets;
$this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); $this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
@ -326,18 +343,19 @@ class PHPExcel_Chart_GridLines extends
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setShadowProperiesMapValues(array $properties_map, &$reference = NULL) { private function _setShadowProperiesMapValues(array $properties_map, &$reference = null)
{
$base_reference = $reference; $base_reference = $reference;
foreach ($properties_map as $property_key => $property_val) { foreach ($properties_map as $property_key => $property_val) {
if (is_array($property_val)) { if (is_array($property_val)) {
if ($reference === NULL) { if ($reference === null) {
$reference = & $this->_shadow_properties[$property_key]; $reference = & $this->_shadow_properties[$property_key];
} else { } else {
$reference = & $reference[$property_key]; $reference = & $reference[$property_key];
} }
$this->_setShadowProperiesMapValues($property_val, $reference); $this->_setShadowProperiesMapValues($property_val, $reference);
} else { } else {
if ($base_reference === NULL) { if ($base_reference === null) {
$this->_shadow_properties[$property_key] = $property_val; $this->_shadow_properties[$property_key] = $property_val;
} else { } else {
$reference[$property_key] = $property_val; $reference[$property_key] = $property_val;
@ -356,7 +374,8 @@ class PHPExcel_Chart_GridLines extends
* @param string $type * @param string $type
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setShadowColor($color, $alpha, $type) { private function _setShadowColor($color, $alpha, $type)
{
if (!is_null($color)) { if (!is_null($color)) {
$this->_shadow_properties['color']['value'] = (string) $color; $this->_shadow_properties['color']['value'] = (string) $color;
} }
@ -377,8 +396,9 @@ class PHPExcel_Chart_GridLines extends
* *
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setShadowBlur($blur) { private function _setShadowBlur($blur)
if ($blur !== NULL) { {
if ($blur !== null) {
$this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur); $this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur);
} }
@ -392,8 +412,9 @@ class PHPExcel_Chart_GridLines extends
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setShadowAngle($angle) { private function _setShadowAngle($angle)
if ($angle !== NULL) { {
if ($angle !== null) {
$this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle); $this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle);
} }
@ -406,8 +427,9 @@ class PHPExcel_Chart_GridLines extends
* @param float $distance * @param float $distance
* @return PHPExcel_Chart_GridLines * @return PHPExcel_Chart_GridLines
*/ */
private function _setShadowDistance($distance) { private function _setShadowDistance($distance)
if ($distance !== NULL) { {
if ($distance !== null) {
$this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance); $this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance);
} }
@ -421,7 +443,8 @@ class PHPExcel_Chart_GridLines extends
* @param array $elements * @param array $elements
* @return string * @return string
*/ */
public function getShadowProperty($elements) { public function getShadowProperty($elements)
{
return $this->getArrayElementsValue($this->_shadow_properties, $elements); return $this->getArrayElementsValue($this->_shadow_properties, $elements);
} }
@ -430,7 +453,8 @@ class PHPExcel_Chart_GridLines extends
* *
* @param float $size * @param float $size
*/ */
public function setSoftEdgesSize($size) { public function setSoftEdgesSize($size)
{
if (!is_null($size)) { if (!is_null($size)) {
$this->_activateObject(); $this->_activateObject();
$_soft_edges['size'] = (string) $this->getExcelPointsWidth($size); $_soft_edges['size'] = (string) $this->getExcelPointsWidth($size);
@ -442,7 +466,8 @@ class PHPExcel_Chart_GridLines extends
* *
* @return string * @return string
*/ */
public function getSoftEdgesSize() { public function getSoftEdgesSize()
{
return $this->_soft_edges['size']; return $this->_soft_edges['size'];
} }
} }

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

@ -79,7 +79,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @var PHPExcel_Worksheet_AutoFilter * @var PHPExcel_Worksheet_AutoFilter
*/ */
private $_parent = NULL; private $_parent = null;
/** /**
@ -128,7 +128,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param string $pColumn Column (e.g. A) * @param string $pColumn Column (e.g. A)
* @param PHPExcel_Worksheet_AutoFilter $pParent Autofilter for this column * @param PHPExcel_Worksheet_AutoFilter $pParent Autofilter for this column
*/ */
public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = NULL) public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = null)
{ {
$this->_columnIndex = $pColumn; $this->_columnIndex = $pColumn;
$this->_parent = $pParent; $this->_parent = $pParent;
@ -139,7 +139,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return string * @return string
*/ */
public function getColumnIndex() { public function getColumnIndex()
{
return $this->_columnIndex; return $this->_columnIndex;
} }
@ -150,10 +151,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setColumnIndex($pColumn) { public function setColumnIndex($pColumn)
{
// Uppercase coordinate // Uppercase coordinate
$pColumn = strtoupper($pColumn); $pColumn = strtoupper($pColumn);
if ($this->_parent !== NULL) { if ($this->_parent !== null) {
$this->_parent->testColumnInRange($pColumn); $this->_parent->testColumnInRange($pColumn);
} }
@ -167,7 +169,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return PHPExcel_Worksheet_AutoFilter * @return PHPExcel_Worksheet_AutoFilter
*/ */
public function getParent() { public function getParent()
{
return $this->_parent; return $this->_parent;
} }
@ -177,7 +180,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param PHPExcel_Worksheet_AutoFilter * @param PHPExcel_Worksheet_AutoFilter
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = NULL) { public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = null)
{
$this->_parent = $pParent; $this->_parent = $pParent;
return $this; return $this;
@ -188,7 +192,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return string * @return string
*/ */
public function getFilterType() { public function getFilterType()
{
return $this->_filterType; return $this->_filterType;
} }
@ -199,7 +204,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER) { public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
{
if (!in_array($pFilterType, self::$_filterTypes)) { if (!in_array($pFilterType, self::$_filterTypes)) {
throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.'); throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.');
} }
@ -225,7 +231,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) { public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR)
{
// Lowercase And/Or // Lowercase And/Or
$pJoin = strtolower($pJoin); $pJoin = strtolower($pJoin);
if (!in_array($pJoin, self::$_ruleJoins)) { if (!in_array($pJoin, self::$_ruleJoins)) {
@ -244,7 +251,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setAttributes($pAttributes = array()) { public function setAttributes($pAttributes = array())
{
$this->_attributes = $pAttributes; $this->_attributes = $pAttributes;
return $this; return $this;
@ -258,7 +266,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setAttribute($pName, $pValue) { public function setAttribute($pName, $pValue)
{
$this->_attributes[$pName] = $pValue; $this->_attributes[$pName] = $pValue;
return $this; return $this;
@ -269,7 +278,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return string * @return string
*/ */
public function getAttributes() { public function getAttributes()
{
return $this->_attributes; return $this->_attributes;
} }
@ -279,10 +289,12 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param string $pName Attribute Name * @param string $pName Attribute Name
* @return string * @return string
*/ */
public function getAttribute($pName) { public function getAttribute($pName)
if (isset($this->_attributes[$pName])) {
if (isset($this->_attributes[$pName])) {
return $this->_attributes[$pName]; return $this->_attributes[$pName];
return NULL; }
return null;
} }
/** /**
@ -291,7 +303,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule * @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function getRules() { public function getRules()
{
return $this->_ruleset; return $this->_ruleset;
} }
@ -301,7 +314,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param integer $pIndex Rule index in the ruleset array * @param integer $pIndex Rule index in the ruleset array
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function getRule($pIndex) { public function getRule($pIndex)
{
if (!isset($this->_ruleset[$pIndex])) { if (!isset($this->_ruleset[$pIndex])) {
$this->_ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this); $this->_ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
} }
@ -313,7 +327,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function createRule() { public function createRule()
{
$this->_ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this); $this->_ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
return end($this->_ruleset); return end($this->_ruleset);
@ -326,7 +341,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned * @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned
* @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule=TRUE) { public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule = true)
{
$pRule->setParent($this); $pRule->setParent($this);
$this->_ruleset[] = $pRule; $this->_ruleset[] = $pRule;
@ -340,7 +356,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param integer $pIndex Rule index in the ruleset array * @param integer $pIndex Rule index in the ruleset array
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function deleteRule($pIndex) { public function deleteRule($pIndex)
{
if (isset($this->_ruleset[$pIndex])) { if (isset($this->_ruleset[$pIndex])) {
unset($this->_ruleset[$pIndex]); unset($this->_ruleset[$pIndex]);
// If we've just deleted down to a single rule, then reset And/Or joining to Or // If we've just deleted down to a single rule, then reset And/Or joining to Or
@ -357,7 +374,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function clearRules() { public function clearRules()
{
$this->_ruleset = array(); $this->_ruleset = array();
$this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR); $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
@ -367,13 +385,14 @@ class PHPExcel_Worksheet_AutoFilter_Column
/** /**
* 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)) {
if ($key == '_parent') { if ($key == '_parent') {
// Detach from autofilter parent // Detach from autofilter parent
$this->$key = NULL; $this->$key = null;
} else { } else {
$this->$key = clone $value; $this->$key = clone $value;
} }

View File

@ -234,7 +234,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @var PHPExcel_Worksheet_AutoFilter_Column * @var PHPExcel_Worksheet_AutoFilter_Column
*/ */
private $_parent = NULL; private $_parent = null;
/** /**
@ -272,7 +272,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @param PHPExcel_Worksheet_AutoFilter_Column $pParent * @param PHPExcel_Worksheet_AutoFilter_Column $pParent
*/ */
public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = NULL) public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
{ {
$this->_parent = $pParent; $this->_parent = $pParent;
} }
@ -282,7 +282,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getRuleType() { public function getRuleType()
{
return $this->_ruleType; return $this->_ruleType;
} }
@ -293,7 +294,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER) { public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER)
{
if (!in_array($pRuleType, self::$_ruleTypes)) { if (!in_array($pRuleType, self::$_ruleTypes)) {
throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.'); throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
} }
@ -308,7 +310,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getValue() { public function getValue()
{
return $this->_value; return $this->_value;
} }
@ -319,7 +322,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setValue($pValue = '') { public function setValue($pValue = '')
{
if (is_array($pValue)) { if (is_array($pValue)) {
$grouping = -1; $grouping = -1;
foreach ($pValue as $key => $value) { foreach ($pValue as $key => $value) {
@ -348,7 +352,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getOperator() { public function getOperator()
{
return $this->_operator; return $this->_operator;
} }
@ -359,9 +364,11 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL) { public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL)
if (empty($pOperator)) {
if (empty($pOperator)) {
$pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL; $pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
}
if ((!in_array($pOperator, self::$_operators)) && if ((!in_array($pOperator, self::$_operators)) &&
(!in_array($pOperator, self::$_topTenValue))) { (!in_array($pOperator, self::$_topTenValue))) {
throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.'); throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.');
@ -376,7 +383,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getGrouping() { public function getGrouping()
{
return $this->_grouping; return $this->_grouping;
} }
@ -387,14 +395,14 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setGrouping($pGrouping = NULL) { public function setGrouping($pGrouping = null)
if (($pGrouping !== NULL) && {
if (($pGrouping !== null) &&
(!in_array($pGrouping, self::$_dateTimeGroups)) && (!in_array($pGrouping, self::$_dateTimeGroups)) &&
(!in_array($pGrouping, self::$_dynamicTypes)) && (!in_array($pGrouping, self::$_dynamicTypes)) &&
(!in_array($pGrouping, self::$_topTenType))) { (!in_array($pGrouping, self::$_topTenType))) {
throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.'); throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
} }
$this->_grouping = $pGrouping; $this->_grouping = $pGrouping;
return $this; return $this;
@ -409,14 +417,16 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = NULL) { public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null)
{
$this->setOperator($pOperator); $this->setOperator($pOperator);
$this->setValue($pValue); $this->setValue($pValue);
// Only set grouping if it's been passed in as a user-supplied argument, // Only set grouping if it's been passed in as a user-supplied argument,
// otherwise we're calculating it when we setValue() and don't want to overwrite that // otherwise we're calculating it when we setValue() and don't want to overwrite that
// If the user supplies an argumnet for grouping, then on their own head be it // If the user supplies an argumnet for grouping, then on their own head be it
if ($pGrouping !== NULL) if ($pGrouping !== null) {
$this->setGrouping($pGrouping); $this->setGrouping($pGrouping);
}
return $this; return $this;
} }
@ -426,7 +436,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function getParent() { public function getParent()
{
return $this->_parent; return $this->_parent;
} }
@ -436,7 +447,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @param PHPExcel_Worksheet_AutoFilter_Column * @param PHPExcel_Worksheet_AutoFilter_Column
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = NULL) { public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
{
$this->_parent = $pParent; $this->_parent = $pParent;
return $this; return $this;
@ -445,13 +457,14 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
/** /**
* 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)) {
if ($key == '_parent') { if ($key == '_parent') {
// Detach from autofilter column parent // Detach from autofilter column parent
$this->$key = NULL; $this->$key = null;
} else { } else {
$this->$key = clone $value; $this->$key = clone $value;
} }
@ -460,5 +473,4 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
} }
} }
} }
} }

View File

@ -154,7 +154,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getImageIndex() { public function getImageIndex()
{
return $this->_imageIndex; return $this->_imageIndex;
} }
@ -163,7 +164,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string * @return string
*/ */
public function getName() { public function getName()
{
return $this->_name; return $this->_name;
} }
@ -173,7 +175,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setName($pValue = '') { public function setName($pValue = '')
{
$this->_name = $pValue; $this->_name = $pValue;
return $this; return $this;
} }
@ -183,7 +186,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string * @return string
*/ */
public function getDescription() { public function getDescription()
{
return $this->_description; return $this->_description;
} }
@ -193,7 +197,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setDescription($pValue = '') { public function setDescription($pValue = '')
{
$this->_description = $pValue; $this->_description = $pValue;
return $this; return $this;
} }
@ -203,7 +208,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return PHPExcel_Worksheet * @return PHPExcel_Worksheet
*/ */
public function getWorksheet() { public function getWorksheet()
{
return $this->_worksheet; return $this->_worksheet;
} }
@ -215,7 +221,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false) { public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false)
{
if (is_null($this->_worksheet)) { if (is_null($this->_worksheet)) {
// Add drawing to PHPExcel_Worksheet // Add drawing to PHPExcel_Worksheet
$this->_worksheet = $pValue; $this->_worksheet = $pValue;
@ -248,7 +255,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string * @return string
*/ */
public function getCoordinates() { public function getCoordinates()
{
return $this->_coordinates; return $this->_coordinates;
} }
@ -258,7 +266,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setCoordinates($pValue = 'A1') { public function setCoordinates($pValue = 'A1')
{
$this->_coordinates = $pValue; $this->_coordinates = $pValue;
return $this; return $this;
} }
@ -268,7 +277,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getOffsetX() { public function getOffsetX()
{
return $this->_offsetX; return $this->_offsetX;
} }
@ -278,7 +288,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setOffsetX($pValue = 0) { public function setOffsetX($pValue = 0)
{
$this->_offsetX = $pValue; $this->_offsetX = $pValue;
return $this; return $this;
} }
@ -288,7 +299,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getOffsetY() { public function getOffsetY()
{
return $this->_offsetY; return $this->_offsetY;
} }
@ -298,7 +310,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setOffsetY($pValue = 0) { public function setOffsetY($pValue = 0)
{
$this->_offsetY = $pValue; $this->_offsetY = $pValue;
return $this; return $this;
} }
@ -308,7 +321,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getWidth() { public function getWidth()
{
return $this->_width; return $this->_width;
} }
@ -318,7 +332,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setWidth($pValue = 0) { public function setWidth($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_height / ($this->_width != 0 ? $this->_width : 1); $ratio = $this->_height / ($this->_width != 0 ? $this->_width : 1);
@ -336,7 +351,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getHeight() { public function getHeight()
{
return $this->_height; return $this->_height;
} }
@ -346,7 +362,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setHeight($pValue = 0) { public function setHeight($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_width / ($this->_height != 0 ? $this->_height : 1); $ratio = $this->_width / ($this->_height != 0 ? $this->_height : 1);
@ -372,7 +389,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $height * @param int $height
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setWidthAndHeight($width = 0, $height = 0) { public function setWidthAndHeight($width = 0, $height = 0)
{
$xratio = $width / ($this->_width != 0 ? $this->_width : 1); $xratio = $width / ($this->_width != 0 ? $this->_width : 1);
$yratio = $height / ($this->_height != 0 ? $this->_height : 1); $yratio = $height / ($this->_height != 0 ? $this->_height : 1);
if ($this->_resizeProportional && !($width == 0 || $height == 0)) { if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
@ -396,7 +414,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return boolean * @return boolean
*/ */
public function getResizeProportional() { public function getResizeProportional()
{
return $this->_resizeProportional; return $this->_resizeProportional;
} }
@ -406,7 +425,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setResizeProportional($pValue = true) { public function setResizeProportional($pValue = true)
{
$this->_resizeProportional = $pValue; $this->_resizeProportional = $pValue;
return $this; return $this;
} }
@ -416,7 +436,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getRotation() { public function getRotation()
{
return $this->_rotation; return $this->_rotation;
} }
@ -426,7 +447,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setRotation($pValue = 0) { public function setRotation($pValue = 0)
{
$this->_rotation = $pValue; $this->_rotation = $pValue;
return $this; return $this;
} }
@ -436,7 +458,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return PHPExcel_Worksheet_Drawing_Shadow * @return PHPExcel_Worksheet_Drawing_Shadow
*/ */
public function getShadow() { public function getShadow()
{
return $this->_shadow; return $this->_shadow;
} }
@ -447,7 +470,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null) { public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null)
{
$this->_shadow = $pValue; $this->_shadow = $pValue;
return $this; return $this;
} }
@ -457,26 +481,16 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string Hash code * @return string Hash code
*/ */
public function getHashCode() { public function getHashCode()
return md5( {
$this->_name return md5($this->_name.$this->_description.$this->_worksheet->getHashCode().$this->_coordinates.$this->_offsetX.$this->_offsetY.$this->_width.$this->_height.$this->_rotation.$this->_shadow->getHashCode().__CLASS__);
. $this->_description
. $this->_worksheet->getHashCode()
. $this->_coordinates
. $this->_offsetX
. $this->_offsetY
. $this->_width
. $this->_height
. $this->_rotation
. $this->_shadow->getHashCode()
. __CLASS__
);
} }
/** /**
* 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

@ -104,7 +104,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getName() { public function getName()
{
return $this->_name; return $this->_name;
} }
@ -114,7 +115,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setName($pValue = '') { public function setName($pValue = '')
{
$this->_name = $pValue; $this->_name = $pValue;
return $this; return $this;
} }
@ -124,7 +126,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getOffsetX() { public function getOffsetX()
{
return $this->_offsetX; return $this->_offsetX;
} }
@ -134,7 +137,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setOffsetX($pValue = 0) { public function setOffsetX($pValue = 0)
{
$this->_offsetX = $pValue; $this->_offsetX = $pValue;
return $this; return $this;
} }
@ -144,7 +148,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getOffsetY() { public function getOffsetY()
{
return $this->_offsetY; return $this->_offsetY;
} }
@ -154,7 +159,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setOffsetY($pValue = 0) { public function setOffsetY($pValue = 0)
{
$this->_offsetY = $pValue; $this->_offsetY = $pValue;
return $this; return $this;
} }
@ -164,7 +170,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getWidth() { public function getWidth()
{
return $this->_width; return $this->_width;
} }
@ -174,7 +181,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setWidth($pValue = 0) { public function setWidth($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_width / $this->_height; $ratio = $this->_width / $this->_height;
@ -192,7 +200,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getHeight() { public function getHeight()
{
return $this->_height; return $this->_height;
} }
@ -202,7 +211,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setHeight($pValue = 0) { public function setHeight($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_width / $this->_height; $ratio = $this->_width / $this->_height;
@ -228,7 +238,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $height * @param int $height
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setWidthAndHeight($width = 0, $height = 0) { public function setWidthAndHeight($width = 0, $height = 0)
{
$xratio = $width / $this->_width; $xratio = $width / $this->_width;
$yratio = $height / $this->_height; $yratio = $height / $this->_height;
if ($this->_resizeProportional && !($width == 0 || $height == 0)) { if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
@ -248,7 +259,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return boolean * @return boolean
*/ */
public function getResizeProportional() { public function getResizeProportional()
{
return $this->_resizeProportional; return $this->_resizeProportional;
} }
@ -258,7 +270,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setResizeProportional($pValue = true) { public function setResizeProportional($pValue = true)
{
$this->_resizeProportional = $pValue; $this->_resizeProportional = $pValue;
return $this; return $this;
} }
@ -268,7 +281,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getFilename() { public function getFilename()
{
return basename($this->_path); return basename($this->_path);
} }
@ -277,7 +291,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getExtension() { public function getExtension()
{
$parts = explode(".", basename($this->_path)); $parts = explode(".", basename($this->_path));
return end($parts); return end($parts);
} }
@ -287,7 +302,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getPath() { public function getPath()
{
return $this->_path; return $this->_path;
} }
@ -299,7 +315,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setPath($pValue = '', $pVerifyFile = true) { public function setPath($pValue = '', $pVerifyFile = true)
{
if ($pVerifyFile) { if ($pVerifyFile) {
if (file_exists($pValue)) { if (file_exists($pValue)) {
$this->_path = $pValue; $this->_path = $pValue;
@ -322,7 +339,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string Hash code * @return string Hash code
*/ */
public function getHashCode() { public function getHashCode()
{
return md5( return md5(
$this->_path $this->_path
. $this->_name . $this->_name
@ -337,7 +355,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
/** /**
* 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

@ -95,7 +95,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return resource * @return resource
*/ */
public function getImageResource() { public function getImageResource()
{
return $this->_imageResource; return $this->_imageResource;
} }
@ -105,7 +106,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* @param $value resource * @param $value resource
* @return PHPExcel_Worksheet_MemoryDrawing * @return PHPExcel_Worksheet_MemoryDrawing
*/ */
public function setImageResource($value = null) { public function setImageResource($value = null)
{
$this->_imageResource = $value; $this->_imageResource = $value;
if (!is_null($this->_imageResource)) { if (!is_null($this->_imageResource)) {
@ -121,7 +123,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string * @return string
*/ */
public function getRenderingFunction() { public function getRenderingFunction()
{
return $this->_renderingFunction; return $this->_renderingFunction;
} }
@ -131,7 +134,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* @param string $value * @param string $value
* @return PHPExcel_Worksheet_MemoryDrawing * @return PHPExcel_Worksheet_MemoryDrawing
*/ */
public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT) { public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT)
{
$this->_renderingFunction = $value; $this->_renderingFunction = $value;
return $this; return $this;
} }
@ -141,7 +145,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string * @return string
*/ */
public function getMimeType() { public function getMimeType()
{
return $this->_mimeType; return $this->_mimeType;
} }
@ -151,7 +156,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* @param string $value * @param string $value
* @return PHPExcel_Worksheet_MemoryDrawing * @return PHPExcel_Worksheet_MemoryDrawing
*/ */
public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT) { public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT)
{
$this->_mimeType = $value; $this->_mimeType = $value;
return $this; return $this;
} }
@ -161,7 +167,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string * @return string
*/ */
public function getIndexedFilename() { public function getIndexedFilename()
{
$extension = strtolower($this->getMimeType()); $extension = strtolower($this->getMimeType());
$extension = explode('/', $extension); $extension = explode('/', $extension);
$extension = $extension[1]; $extension = $extension[1];
@ -174,7 +181,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string Hash code * @return string Hash code
*/ */
public function getHashCode() { public function getHashCode()
{
return md5( return md5(
$this->_renderingFunction $this->_renderingFunction
. $this->_mimeType . $this->_mimeType

View File

@ -89,7 +89,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getLeft() { public function getLeft()
{
return $this->_left; return $this->_left;
} }
@ -99,7 +100,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setLeft($pValue) { public function setLeft($pValue)
{
$this->_left = $pValue; $this->_left = $pValue;
return $this; return $this;
} }
@ -109,7 +111,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getRight() { public function getRight()
{
return $this->_right; return $this->_right;
} }
@ -119,7 +122,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setRight($pValue) { public function setRight($pValue)
{
$this->_right = $pValue; $this->_right = $pValue;
return $this; return $this;
} }
@ -129,7 +133,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getTop() { public function getTop()
{
return $this->_top; return $this->_top;
} }
@ -139,7 +144,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setTop($pValue) { public function setTop($pValue)
{
$this->_top = $pValue; $this->_top = $pValue;
return $this; return $this;
} }
@ -149,7 +155,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getBottom() { public function getBottom()
{
return $this->_bottom; return $this->_bottom;
} }
@ -159,7 +166,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setBottom($pValue) { public function setBottom($pValue)
{
$this->_bottom = $pValue; $this->_bottom = $pValue;
return $this; return $this;
} }
@ -169,7 +177,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getHeader() { public function getHeader()
{
return $this->_header; return $this->_header;
} }
@ -179,7 +188,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setHeader($pValue) { public function setHeader($pValue)
{
$this->_header = $pValue; $this->_header = $pValue;
return $this; return $this;
} }
@ -189,7 +199,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getFooter() { public function getFooter()
{
return $this->_footer; return $this->_footer;
} }
@ -199,7 +210,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setFooter($pValue) { public function setFooter($pValue)
{
$this->_footer = $pValue; $this->_footer = $pValue;
return $this; return $this;
} }
@ -207,7 +219,8 @@ class PHPExcel_Worksheet_PageMargins
/** /**
* 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

@ -86,7 +86,8 @@ class PHPExcel_Worksheet_SheetView
* *
* @return int * @return int
*/ */
public function getZoomScale() { public function getZoomScale()
{
return $this->_zoomScale; return $this->_zoomScale;
} }
@ -99,7 +100,8 @@ class PHPExcel_Worksheet_SheetView
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView * @return PHPExcel_Worksheet_SheetView
*/ */
public function setZoomScale($pValue = 100) { public function setZoomScale($pValue = 100)
{
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface, // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
// but it is apparently still able to handle any scale >= 1 // but it is apparently still able to handle any scale >= 1
if (($pValue >= 1) || is_null($pValue)) { if (($pValue >= 1) || is_null($pValue)) {
@ -115,7 +117,8 @@ class PHPExcel_Worksheet_SheetView
* *
* @return int * @return int
*/ */
public function getZoomScaleNormal() { public function getZoomScaleNormal()
{
return $this->_zoomScaleNormal; return $this->_zoomScaleNormal;
} }
@ -128,7 +131,8 @@ class PHPExcel_Worksheet_SheetView
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView * @return PHPExcel_Worksheet_SheetView
*/ */
public function setZoomScaleNormal($pValue = 100) { public function setZoomScaleNormal($pValue = 100)
{
if (($pValue >= 1) || is_null($pValue)) { if (($pValue >= 1) || is_null($pValue)) {
$this->_zoomScaleNormal = $pValue; $this->_zoomScaleNormal = $pValue;
} else { } else {
@ -142,7 +146,8 @@ class PHPExcel_Worksheet_SheetView
* *
* @return string * @return string
*/ */
public function getView() { public function getView()
{
return $this->_sheetviewType; return $this->_sheetviewType;
} }
@ -158,11 +163,12 @@ class PHPExcel_Worksheet_SheetView
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView * @return PHPExcel_Worksheet_SheetView
*/ */
public function setView($pValue = NULL) { public function setView($pValue = null)
// MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' {
// via the user interface // MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' via the user interface
if ($pValue === NULL) if ($pValue === null) {
$pValue = self::SHEETVIEW_NORMAL; $pValue = self::SHEETVIEW_NORMAL;
}
if (in_array($pValue, self::$_sheetViewTypes)) { if (in_array($pValue, self::$_sheetViewTypes)) {
$this->_sheetviewType = $pValue; $this->_sheetviewType = $pValue;
} else { } else {
@ -175,7 +181,8 @@ class PHPExcel_Worksheet_SheetView
/** /**
* 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

@ -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

@ -199,7 +199,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = FALSE) public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false)
{ {
// Create XML writer // Create XML writer
$objWriter = null; $objWriter = null;
@ -308,7 +308,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = FALSE) public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
{ {
// Create XML writer // Create XML writer
$objWriter = null; $objWriter = null;

View File

@ -42,7 +42,8 @@ class PHPExcel_Writer_Excel2007_RelsRibbon extends PHPExcel_Writer_Excel2007_Wri
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeRibbonRelationships(PHPExcel $pPHPExcel = null){ public function writeRibbonRelationships(PHPExcel $pPHPExcel = null)
{
// Create XML writer // Create XML writer
$objWriter = null; $objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) { if ($this->getParentWriter()->getUseDiskCaching()) {
@ -71,7 +72,5 @@ class PHPExcel_Writer_Excel2007_RelsRibbon extends PHPExcel_Writer_Excel2007_Wri
// Return // Return
return $objWriter->getData(); return $objWriter->getData();
} }
} }

View File

@ -42,7 +42,8 @@ class PHPExcel_Writer_Excel2007_RelsVBA extends PHPExcel_Writer_Excel2007_Writer
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeVBARelationships(PHPExcel $pPHPExcel = null){ public function writeVBARelationships(PHPExcel $pPHPExcel = null)
{
// Create XML writer // Create XML writer
$objWriter = null; $objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) { if ($this->getParentWriter()->getUseDiskCaching()) {
@ -68,5 +69,4 @@ class PHPExcel_Writer_Excel2007_RelsVBA extends PHPExcel_Writer_Excel2007_Writer
return $objWriter->getData(); return $objWriter->getData();
} }
} }

View File

@ -45,14 +45,14 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
*/ */
public function createStringTable($pSheet = null, $pExistingTable = null) public function createStringTable($pSheet = null, $pExistingTable = null)
{ {
if ($pSheet !== NULL) { if ($pSheet !== null) {
// Create string lookup table // Create string lookup table
$aStringTable = array(); $aStringTable = array();
$cellCollection = null; $cellCollection = null;
$aFlippedStringTable = null; // For faster lookup $aFlippedStringTable = null; // For faster lookup
// Is an existing table given? // Is an existing table given?
if (($pExistingTable !== NULL) && is_array($pExistingTable)) { if (($pExistingTable !== null) && is_array($pExistingTable)) {
$aStringTable = $pExistingTable; $aStringTable = $pExistingTable;
} }
@ -64,14 +64,14 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
$cell = $pSheet->getCell($cellID); $cell = $pSheet->getCell($cellID);
$cellValue = $cell->getValue(); $cellValue = $cell->getValue();
if (!is_object($cellValue) && if (!is_object($cellValue) &&
($cellValue !== NULL) && ($cellValue !== null) &&
$cellValue !== '' && $cellValue !== '' &&
!isset($aFlippedStringTable[$cellValue]) && !isset($aFlippedStringTable[$cellValue]) &&
($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING2 || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)) { ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING2 || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)) {
$aStringTable[] = $cellValue; $aStringTable[] = $cellValue;
$aFlippedStringTable[$cellValue] = true; $aFlippedStringTable[$cellValue] = true;
} elseif ($cellValue instanceof PHPExcel_RichText && } elseif ($cellValue instanceof PHPExcel_RichText &&
($cellValue !== NULL) && ($cellValue !== null) &&
!isset($aFlippedStringTable[$cellValue->getHashCode()])) { !isset($aFlippedStringTable[$cellValue->getHashCode()])) {
$aStringTable[] = $cellValue; $aStringTable[] = $cellValue;
$aFlippedStringTable[$cellValue->getHashCode()] = true; $aFlippedStringTable[$cellValue->getHashCode()] = true;
@ -94,7 +94,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
*/ */
public function writeStringTable($pStringTable = null) public function writeStringTable($pStringTable = null)
{ {
if ($pStringTable !== NULL) { if ($pStringTable !== null) {
// Create XML writer // Create XML writer
$objWriter = null; $objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) { if ($this->getParentWriter()->getUseDiskCaching()) {
@ -147,10 +147,12 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
* @param string $prefix Optional Namespace prefix * @param string $prefix Optional Namespace prefix
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeRichText(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_RichText $pRichText = null, $prefix=NULL) public function writeRichText(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_RichText $pRichText = null, $prefix = null)
{ {
if ($prefix !== NULL) if ($prefix !== null) {
$prefix .= ':'; $prefix .= ':';
}
// Loop through rich text elements // Loop through rich text elements
$elements = $pRichText->getRichTextElements(); $elements = $pRichText->getRichTextElements();
foreach ($elements as $element) { foreach ($elements as $element) {
@ -229,7 +231,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
* @param string $prefix Optional Namespace prefix * @param string $prefix Optional Namespace prefix
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeRichTextForCharts(PHPExcel_Shared_XMLWriter $objWriter = null, $pRichText = null, $prefix=NULL) public function writeRichTextForCharts(PHPExcel_Shared_XMLWriter $objWriter = null, $pRichText = null, $prefix = null)
{ {
if (!$pRichText instanceof PHPExcel_RichText) { if (!$pRichText instanceof PHPExcel_RichText) {
$textRun = $pRichText; $textRun = $pRichText;
@ -237,8 +239,10 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
$pRichText->createTextRun($textRun); $pRichText->createTextRun($textRun);
} }
if ($prefix !== NULL) if ($prefix !== null) {
$prefix .= ':'; $prefix .= ':';
}
// Loop through rich text elements // Loop through rich text elements
$elements = $pRichText->getRichTextElements(); $elements = $pRichText->getRichTextElements();
foreach ($elements as $element) { foreach ($elements as $element) {

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

@ -44,7 +44,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
* @return string XML Output * @return string XML Output
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
public function writeWorksheet($pSheet = null, $pStringTable = null, $includeCharts = FALSE) public function writeWorksheet($pSheet = null, $pStringTable = null, $includeCharts = false)
{ {
if (!is_null($pSheet)) { if (!is_null($pSheet)) {
// Create XML writer // Create XML writer
@ -205,16 +205,16 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
* @param PHPExcel_Worksheet $pSheet Worksheet * @param PHPExcel_Worksheet $pSheet Worksheet
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = NULL, PHPExcel_Worksheet $pSheet = NULL) private function _writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
{ {
// sheetViews // sheetViews
$objWriter->startElement('sheetViews'); $objWriter->startElement('sheetViews');
// Sheet selected? // Sheet selected?
$sheetSelected = false; $sheetSelected = false;
if ($this->getParentWriter()->getPHPExcel()->getIndex($pSheet) == $this->getParentWriter()->getPHPExcel()->getActiveSheetIndex()) if ($this->getParentWriter()->getPHPExcel()->getIndex($pSheet) == $this->getParentWriter()->getPHPExcel()->getActiveSheetIndex()) {
$sheetSelected = true; $sheetSelected = true;
}
// sheetView // sheetView
$objWriter->startElement('sheetView'); $objWriter->startElement('sheetView');
@ -282,8 +282,12 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
if (($xSplit > 1) && ($ySplit > 1)) { if (($xSplit > 1) && ($ySplit > 1)) {
// Write additional selections if more than two panes (ie both an X and a Y split) // Write additional selections if more than two panes (ie both an X and a Y split)
$objWriter->startElement('selection'); $objWriter->writeAttribute('pane', 'topRight'); $objWriter->endElement(); $objWriter->startElement('selection');
$objWriter->startElement('selection'); $objWriter->writeAttribute('pane', 'bottomLeft'); $objWriter->endElement(); $objWriter->writeAttribute('pane', 'topRight');
$objWriter->endElement();
$objWriter->startElement('selection');
$objWriter->writeAttribute('pane', 'bottomLeft');
$objWriter->endElement();
} }
} }
@ -787,11 +791,11 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
// Dynamic Filter Rule // Dynamic Filter Rule
$objWriter->writeAttribute('type', $rule->getGrouping()); $objWriter->writeAttribute('type', $rule->getGrouping());
$val = $column->getAttribute('val'); $val = $column->getAttribute('val');
if ($val !== NULL) { if ($val !== null) {
$objWriter->writeAttribute('val', $val); $objWriter->writeAttribute('val', $val);
} }
$maxVal = $column->getAttribute('maxVal'); $maxVal = $column->getAttribute('maxVal');
if ($maxVal !== NULL) { if ($maxVal !== null) {
$objWriter->writeAttribute('maxVal', $maxVal); $objWriter->writeAttribute('maxVal', $maxVal);
} }
} elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) { } elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) {
@ -984,12 +988,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
$rowDimension = $pSheet->getRowDimension($currentRow); $rowDimension = $pSheet->getRowDimension($currentRow);
// Write current row? // Write current row?
$writeCurrentRow = isset($cellsByRow[$currentRow]) || $writeCurrentRow = isset($cellsByRow[$currentRow]) || $rowDimension->getRowHeight() >= 0 || $rowDimension->getVisible() == false || $rowDimension->getCollapsed() == true || $rowDimension->getOutlineLevel() > 0 || $rowDimension->getXfIndex() !== null;
$rowDimension->getRowHeight() >= 0 ||
$rowDimension->getVisible() == false ||
$rowDimension->getCollapsed() == true ||
$rowDimension->getOutlineLevel() > 0 ||
$rowDimension->getXfIndex() !== null;
if ($writeCurrentRow) { if ($writeCurrentRow) {
// Start a new row // Start a new row
@ -1172,7 +1171,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
* @param boolean $includeCharts Flag indicating if we should include drawing details for charts * @param boolean $includeCharts Flag indicating if we should include drawing details for charts
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeDrawings(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $includeCharts = FALSE) private function _writeDrawings(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $includeCharts = false)
{ {
$chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0; $chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0;
// If sheet contains drawings, add the relationships // If sheet contains drawings, add the relationships

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
} }
} }

View File

@ -105,7 +105,8 @@ class PHPExcel_Writer_Excel5_Escher
// dgg data // dgg data
$dggData = $dggData =
pack('VVVV', pack(
'VVVV',
$this->_object->getSpIdMax(), // maximum shape identifier increased by one $this->_object->getSpIdMax(), // maximum shape identifier increased by one
$this->_object->getCDgSaved() + 1, // number of file identifier clusters increased by one $this->_object->getCDgSaved() + 1, // number of file identifier clusters increased by one
$this->_object->getCSpSaved(), $this->_object->getCSpSaved(),

View File

@ -1130,60 +1130,39 @@ class PHPExcel_Writer_Excel5_Parser
break; break;
default: default:
// if it's a reference A1 or $A$1 or $A1 or A$1 // if it's a reference A1 or $A$1 or $A1 or A$1
if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/', $token) and if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/', $token) and !preg_match("/[0-9]/", $this->_lookahead) and ($this->_lookahead != ':') and ($this->_lookahead != '.') and ($this->_lookahead != '!')) {
!preg_match("/[0-9]/", $this->_lookahead) and
($this->_lookahead != ':') and ($this->_lookahead != '.') and
($this->_lookahead != '!')) {
return $token; return $token;
} } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->_lookahead) and ($this->_lookahead != ':') and ($this->_lookahead != '.')) {
// If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1)
elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and
!preg_match("/[0-9]/", $this->_lookahead) and
($this->_lookahead != ':') and ($this->_lookahead != '.')) {
return $token; return $token;
} }
elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->_lookahead) and ($this->_lookahead != ':') and ($this->_lookahead != '.')) {
// If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1)
elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $token) and
!preg_match("/[0-9]/", $this->_lookahead) and
($this->_lookahead != ':') and ($this->_lookahead != '.')) {
return $token; return $token;
} } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $token) && !preg_match("/[0-9]/", $this->_lookahead)) {
// if it's a range A1:A2 or $A$1:$A$2 // if it's a range A1:A2 or $A$1:$A$2
elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $token) and
!preg_match("/[0-9]/", $this->_lookahead)) {
return $token; return $token;
} } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->_lookahead)) {
// If it's an external range like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2 // If it's an external range like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2
elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and
!preg_match("/[0-9]/", $this->_lookahead)) {
return $token; return $token;
} } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and !preg_match("/[0-9]/", $this->_lookahead)) {
// If it's an external range like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 // If it's an external range like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2
elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $token) and
!preg_match("/[0-9]/", $this->_lookahead)) {
return $token; return $token;
} } elseif (is_numeric($token) and (!is_numeric($token.$this->_lookahead) or ($this->_lookahead == '')) and ($this->_lookahead != '!') and ($this->_lookahead != ':')) {
// If it's a number (check that it's not a sheet name or range) // If it's a number (check that it's not a sheet name or range)
elseif (is_numeric($token) and
(!is_numeric($token.$this->_lookahead) or ($this->_lookahead == '')) and
($this->_lookahead != '!') and ($this->_lookahead != ':')) {
return $token; return $token;
} } elseif (preg_match("/\"([^\"]|\"\"){0,255}\"/", $token) and $this->_lookahead != '"' and (substr_count($token, '"')%2 == 0)) {
// If it's a string (of maximum 255 characters) // If it's a string (of maximum 255 characters)
elseif (preg_match("/\"([^\"]|\"\"){0,255}\"/", $token) and $this->_lookahead != '"' and (substr_count($token, '"')%2 == 0)) {
return $token; return $token;
} } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') {
// If it's an error code // If it's an error code
elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') {
return $token; return $token;
} } elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i", $token) and ($this->_lookahead == "(")) {
// if it's a function call // if it's a function call
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i", $token) and ($this->_lookahead == "(")) {
return $token; return $token;
} } elseif (substr($token, -1) == ')') {
// It's an argument of some description (e.g. a named range), // It's an argument of some description (e.g. a named range),
// precise nature yet to be determined // precise nature yet to be determined
elseif(substr($token,-1) == ')') {
return $token; return $token;
} }
return ''; return '';
@ -1266,7 +1245,10 @@ class PHPExcel_Writer_Excel5_Parser
// If it's a string return a string node // If it's a string return a string node
if (preg_match("/\"([^\"]|\"\"){0,255}\"/", $this->_current_token)) { if (preg_match("/\"([^\"]|\"\"){0,255}\"/", $this->_current_token)) {
$tmp = str_replace('""', '"', $this->_current_token); $tmp = str_replace('""', '"', $this->_current_token);
if (($tmp == '"') || ($tmp == '')) $tmp = '""'; // Trap for "" that has been used for an empty string if (($tmp == '"') || ($tmp == '')) {
// Trap for "" that has been used for an empty string
$tmp = '""';
}
$result = $this->_createTree($tmp, '', ''); $result = $this->_createTree($tmp, '', '');
$this->_advance(); $this->_advance();
return $result; return $result;
@ -1375,38 +1357,33 @@ class PHPExcel_Writer_Excel5_Parser
return $result; return $result;
} }
// if it's a reference // if it's a reference
if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/', $this->_current_token)) if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/', $this->_current_token)) {
{
$result = $this->_createTree($this->_current_token, '', ''); $result = $this->_createTree($this->_current_token, '', '');
$this->_advance(); $this->_advance();
return $result; return $result;
} }
// If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1)
elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->_current_token)) elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->_current_token)) {
{
$result = $this->_createTree($this->_current_token, '', ''); $result = $this->_createTree($this->_current_token, '', '');
$this->_advance(); $this->_advance();
return $result; return $result;
} }
// If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1)
elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->_current_token)) elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u", $this->_current_token)) {
{
$result = $this->_createTree($this->_current_token, '', ''); $result = $this->_createTree($this->_current_token, '', '');
$this->_advance(); $this->_advance();
return $result; return $result;
} }
// if it's a range A1:B2 or $A$1:$B$2 // if it's a range A1:B2 or $A$1:$B$2
elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $this->_current_token) or elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $this->_current_token) or
preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $this->_current_token)) preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $this->_current_token)) {
{
// must be an error? // must be an error?
$result = $this->_createTree($this->_current_token, '', ''); $result = $this->_createTree($this->_current_token, '', '');
$this->_advance(); $this->_advance();
return $result; return $result;
} }
// If it's an external range (Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2) // If it's an external range (Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2)
elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->_current_token)) elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->_current_token)) {
{
// must be an error? // must be an error?
//$result = $this->_current_token; //$result = $this->_current_token;
$result = $this->_createTree($this->_current_token, '', ''); $result = $this->_createTree($this->_current_token, '', '');
@ -1414,8 +1391,7 @@ class PHPExcel_Writer_Excel5_Parser
return $result; return $result;
} }
// If it's an external range ('Sheet1'!A1:B2 or 'Sheet1'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1'!$A$1:$B$2) // If it's an external range ('Sheet1'!A1:B2 or 'Sheet1'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1'!$A$1:$B$2)
elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->_current_token)) elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->_current_token)) {
{
// must be an error? // must be an error?
//$result = $this->_current_token; //$result = $this->_current_token;
$result = $this->_createTree($this->_current_token, '', ''); $result = $this->_createTree($this->_current_token, '', '');
@ -1423,8 +1399,7 @@ class PHPExcel_Writer_Excel5_Parser
return $result; return $result;
} }
// If it's a number or a percent // If it's a number or a percent
elseif (is_numeric($this->_current_token)) elseif (is_numeric($this->_current_token)) {
{
if ($this->_lookahead == '%') { if ($this->_lookahead == '%') {
$result = $this->_createTree('ptgPercent', $this->_current_token, ''); $result = $this->_createTree('ptgPercent', $this->_current_token, '');
$this->_advance(); // Skip the percentage operator once we've pre-built that tree $this->_advance(); // Skip the percentage operator once we've pre-built that tree
@ -1435,8 +1410,7 @@ class PHPExcel_Writer_Excel5_Parser
return $result; return $result;
} }
// if it's a function call // if it's a function call
elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i", $this->_current_token)) elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i", $this->_current_token)) {
{
$result = $this->_func(); $result = $this->_func();
return $result; return $result;
} }
@ -1462,13 +1436,10 @@ class PHPExcel_Writer_Excel5_Parser
while ($this->_current_token != ')') { while ($this->_current_token != ')') {
/**/ /**/
if ($num_args > 0) { if ($num_args > 0) {
if ($this->_current_token == "," or if ($this->_current_token == "," || $this->_current_token == ";") {
$this->_current_token == ";")
{
$this->_advance(); // eat the "," or ";" $this->_advance(); // eat the "," or ";"
} else { } else {
throw new PHPExcel_Writer_Exception("Syntax error: comma expected in ". throw new PHPExcel_Writer_Exception("Syntax error: comma expected in function $function, arg #{$num_args}");
"function $function, arg #{$num_args}");
} }
$result2 = $this->_condition(); $result2 = $this->_condition();
$result = $this->_createTree('arg', $result, $result2); $result = $this->_createTree('arg', $result, $result2);
@ -1560,8 +1531,7 @@ class PHPExcel_Writer_Excel5_Parser
!preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/', $tree['value']) and !preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/', $tree['value']) and
!preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/", $tree['value']) and !preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/", $tree['value']) and
!is_numeric($tree['value']) and !is_numeric($tree['value']) and
!isset($this->ptg[$tree['value']])) !isset($this->ptg[$tree['value']])) {
{
// left subtree for a function is always an array. // left subtree for a function is always an array.
if ($tree['left'] != '') { if ($tree['left'] != '') {
$left_tree = $this->toReversePolish($tree['left']); $left_tree = $this->toReversePolish($tree['left']);

View File

@ -845,7 +845,8 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
// option flags // option flags
$options = ($isHidden ? 0x21 : 0x00); $options = ($isHidden ? 0x21 : 0x00);
$extra = pack('Cvvvvv', $extra = pack(
'Cvvvvv',
0x3B, 0x3B,
$sheetIndex - 1, $sheetIndex - 1,
$rangeBounds[0][1] - 1, $rangeBounds[0][1] - 1,

View File

@ -2736,7 +2736,8 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
if ($spTypes[$i] == 0x00C9) { if ($spTypes[$i] == 0x00C9) {
// Add ftCmo (common object data) subobject // Add ftCmo (common object data) subobject
$objData .= $objData .=
pack('vvvvvVVV', pack(
'vvvvvVVV',
0x0015, // 0x0015 = ftCmo 0x0015, // 0x0015 = ftCmo
0x0012, // length of ftCmo data 0x0012, // length of ftCmo data
0x0014, // object type, 0x0014 = filter 0x0014, // object type, 0x0014 = filter
@ -2756,7 +2757,8 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
} else { } else {
// Add ftCmo (common object data) subobject // Add ftCmo (common object data) subobject
$objData .= $objData .=
pack('vvvvvVVV', pack(
'vvvvvVVV',
0x0015, // 0x0015 = ftCmo 0x0015, // 0x0015 = ftCmo
0x0012, // length of ftCmo data 0x0012, // length of ftCmo data
0x0008, // object type, 0x0008 = picture 0x0008, // object type, 0x0008 = picture
@ -2770,7 +2772,8 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
// ftEnd // ftEnd
$objData .= $objData .=
pack('vv', pack(
'vv',
0x0000, // 0x0000 = ftEnd 0x0000, // 0x0000 = ftEnd
0x0000 // length of ftEnd data 0x0000 // length of ftEnd data
); );

View File

@ -105,7 +105,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
$objWriter->startElement('office:body'); $objWriter->startElement('office:body');
$objWriter->startElement('office:spreadsheet'); $objWriter->startElement('office:spreadsheet');
$objWriter->writeElement('table:calculation-settings'); $objWriter->writeElement('table:calculation-settings');
$this->_writeSheets($objWriter); $this->writeSheets($objWriter);
$objWriter->writeElement('table:named-expressions'); $objWriter->writeElement('table:named-expressions');
$objWriter->endElement(); $objWriter->endElement();
$objWriter->endElement(); $objWriter->endElement();
@ -119,7 +119,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
* *
* @param PHPExcel_Shared_XMLWriter $objWriter * @param PHPExcel_Shared_XMLWriter $objWriter
*/ */
private function _writeSheets(PHPExcel_Shared_XMLWriter $objWriter) private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter)
{ {
$pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */ $pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
@ -132,7 +132,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
$objWriter->startElement('table:table-column'); $objWriter->startElement('table:table-column');
$objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX); $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
$objWriter->endElement(); $objWriter->endElement();
$this->_writeRows($objWriter, $pPHPExcel->getSheet($i)); $this->writeRows($objWriter, $pPHPExcel->getSheet($i));
$objWriter->endElement(); $objWriter->endElement();
} }
} }
@ -143,7 +143,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
* @param PHPExcel_Shared_XMLWriter $objWriter * @param PHPExcel_Shared_XMLWriter $objWriter
* @param PHPExcel_Worksheet $sheet * @param PHPExcel_Worksheet $sheet
*/ */
private function _writeRows(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet $sheet) private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet $sheet)
{ {
$number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX; $number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX;
$span_row = 0; $span_row = 0;
@ -164,7 +164,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
$span_row = 0; $span_row = 0;
} }
$objWriter->startElement('table:table-row'); $objWriter->startElement('table:table-row');
$this->_writeCells($objWriter, $row); $this->writeCells($objWriter, $row);
$objWriter->endElement(); $objWriter->endElement();
} else { } else {
$span_row++; $span_row++;
@ -180,7 +180,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
* @param PHPExcel_Worksheet_Row $row * @param PHPExcel_Worksheet_Row $row
* @throws PHPExcel_Writer_Exception * @throws PHPExcel_Writer_Exception
*/ */
private function _writeCells(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet_Row $row) private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet_Row $row)
{ {
$number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX; $number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX;
$prev_column = -1; $prev_column = -1;
@ -189,7 +189,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
$cell = $cells->current(); $cell = $cells->current();
$column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1; $column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1;
$this->_writeCellSpan($objWriter, $column, $prev_column); $this->writeCellSpan($objWriter, $column, $prev_column);
$objWriter->startElement('table:table-cell'); $objWriter->startElement('table:table-cell');
switch ($cell->getDataType()) { switch ($cell->getDataType()) {
@ -258,7 +258,7 @@ class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_
* @param integer $curColumn * @param integer $curColumn
* @param integer $prevColumn * @param integer $prevColumn
*/ */
private function _writeCellSpan(PHPExcel_Shared_XMLWriter $objWriter, $curColumn, $prevColumn) private function writeCellSpan(PHPExcel_Shared_XMLWriter $objWriter, $curColumn, $prevColumn)
{ {
$diff = $curColumn - $prevColumn - 1; $diff = $curColumn - $prevColumn - 1;
if (1 === $diff) { if (1 === $diff) {