More PSR-2 work, and eliminate duplicate code in Row/Column dimensions by extension of an abstract Dimension class containing common code/properties

This commit is contained in:
MarkBaker 2015-05-17 10:22:51 +01:00
parent 334747867d
commit f0fdc9430b
9 changed files with 2243 additions and 1993 deletions

File diff suppressed because it is too large Load Diff

View File

@ -39,91 +39,91 @@ class PHPExcel_Chart
* *
* @var PHPExcel_Worksheet * @var PHPExcel_Worksheet
*/ */
private $_worksheet = null; private $worksheet;
/** /**
* Chart Title * Chart Title
* *
* @var PHPExcel_Chart_Title * @var PHPExcel_Chart_Title
*/ */
private $_title = null; private $title;
/** /**
* Chart Legend * Chart Legend
* *
* @var PHPExcel_Chart_Legend * @var PHPExcel_Chart_Legend
*/ */
private $_legend = null; private $legend;
/** /**
* X-Axis Label * X-Axis Label
* *
* @var PHPExcel_Chart_Title * @var PHPExcel_Chart_Title
*/ */
private $_xAxisLabel = null; private $xAxisLabel;
/** /**
* Y-Axis Label * Y-Axis Label
* *
* @var PHPExcel_Chart_Title * @var PHPExcel_Chart_Title
*/ */
private $_yAxisLabel = null; private $yAxisLabel;
/** /**
* Chart Plot Area * Chart Plot Area
* *
* @var PHPExcel_Chart_PlotArea * @var PHPExcel_Chart_PlotArea
*/ */
private $_plotArea = null; private $plotArea;
/** /**
* Plot Visible Only * Plot Visible Only
* *
* @var boolean * @var boolean
*/ */
private $_plotVisibleOnly = true; private $plotVisibleOnly = true;
/** /**
* Display Blanks as * Display Blanks as
* *
* @var string * @var string
*/ */
private $_displayBlanksAs = '0'; private $displayBlanksAs = '0';
/** /**
* Chart Asix Y as * Chart Asix Y as
* *
* @var PHPExcel_Chart_Axis * @var PHPExcel_Chart_Axis
*/ */
private $_yAxis = null; private $yAxis;
/** /**
* Chart Asix X as * Chart Asix X as
* *
* @var PHPExcel_Chart_Axis * @var PHPExcel_Chart_Axis
*/ */
private $_xAxis = null; private $xAxis;
/** /**
* Chart Major Gridlines as * Chart Major Gridlines as
* *
* @var PHPExcel_Chart_GridLines * @var PHPExcel_Chart_GridLines
*/ */
private $_majorGridlines = null; private $majorGridlines;
/** /**
* Chart Minor Gridlines as * Chart Minor Gridlines as
* *
* @var PHPExcel_Chart_GridLines * @var PHPExcel_Chart_GridLines
*/ */
private $_minorGridlines = null; private $minorGridlines;
/** /**
* Top-Left Cell Position * Top-Left Cell Position
* *
* @var string * @var string
*/ */
private $_topLeftCellRef = 'A1'; private $topLeftCellRef = 'A1';
/** /**
@ -131,7 +131,7 @@ class PHPExcel_Chart
* *
* @var integer * @var integer
*/ */
private $_topLeftXOffset = 0; private $topLeftXOffset = 0;
/** /**
@ -139,7 +139,7 @@ class PHPExcel_Chart
* *
* @var integer * @var integer
*/ */
private $_topLeftYOffset = 0; private $topLeftYOffset = 0;
/** /**
@ -147,7 +147,7 @@ class PHPExcel_Chart
* *
* @var string * @var string
*/ */
private $_bottomRightCellRef = 'A1'; private $bottomRightCellRef = 'A1';
/** /**
@ -155,7 +155,7 @@ class PHPExcel_Chart
* *
* @var integer * @var integer
*/ */
private $_bottomRightXOffset = 10; private $bottomRightXOffset = 10;
/** /**
@ -163,7 +163,7 @@ class PHPExcel_Chart
* *
* @var integer * @var integer
*/ */
private $_bottomRightYOffset = 10; private $bottomRightYOffset = 10;
/** /**
@ -172,17 +172,17 @@ class PHPExcel_Chart
public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null) public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null)
{ {
$this->_name = $name; $this->_name = $name;
$this->_title = $title; $this->title = $title;
$this->_legend = $legend; $this->legend = $legend;
$this->_xAxisLabel = $xAxisLabel; $this->xAxisLabel = $xAxisLabel;
$this->_yAxisLabel = $yAxisLabel; $this->yAxisLabel = $yAxisLabel;
$this->_plotArea = $plotArea; $this->plotArea = $plotArea;
$this->_plotVisibleOnly = $plotVisibleOnly; $this->plotVisibleOnly = $plotVisibleOnly;
$this->_displayBlanksAs = $displayBlanksAs; $this->displayBlanksAs = $displayBlanksAs;
$this->_xAxis = $xAxis; $this->xAxis = $xAxis;
$this->_yAxis = $yAxis; $this->yAxis = $yAxis;
$this->_majorGridlines = $majorGridlines; $this->majorGridlines = $majorGridlines;
$this->_minorGridlines = $minorGridlines; $this->minorGridlines = $minorGridlines;
} }
/** /**
@ -202,7 +202,7 @@ class PHPExcel_Chart
*/ */
public function getWorksheet() public function getWorksheet()
{ {
return $this->_worksheet; return $this->worksheet;
} }
/** /**
@ -214,7 +214,7 @@ class PHPExcel_Chart
*/ */
public function setWorksheet(PHPExcel_Worksheet $pValue = null) public function setWorksheet(PHPExcel_Worksheet $pValue = null)
{ {
$this->_worksheet = $pValue; $this->worksheet = $pValue;
return $this; return $this;
} }
@ -226,7 +226,7 @@ class PHPExcel_Chart
*/ */
public function getTitle() public function getTitle()
{ {
return $this->_title; return $this->title;
} }
/** /**
@ -237,7 +237,7 @@ class PHPExcel_Chart
*/ */
public function setTitle(PHPExcel_Chart_Title $title) public function setTitle(PHPExcel_Chart_Title $title)
{ {
$this->_title = $title; $this->title = $title;
return $this; return $this;
} }
@ -249,7 +249,7 @@ class PHPExcel_Chart
*/ */
public function getLegend() public function getLegend()
{ {
return $this->_legend; return $this->legend;
} }
/** /**
@ -260,7 +260,7 @@ class PHPExcel_Chart
*/ */
public function setLegend(PHPExcel_Chart_Legend $legend) public function setLegend(PHPExcel_Chart_Legend $legend)
{ {
$this->_legend = $legend; $this->legend = $legend;
return $this; return $this;
} }
@ -272,7 +272,7 @@ class PHPExcel_Chart
*/ */
public function getXAxisLabel() public function getXAxisLabel()
{ {
return $this->_xAxisLabel; return $this->xAxisLabel;
} }
/** /**
@ -283,7 +283,7 @@ class PHPExcel_Chart
*/ */
public function setXAxisLabel(PHPExcel_Chart_Title $label) public function setXAxisLabel(PHPExcel_Chart_Title $label)
{ {
$this->_xAxisLabel = $label; $this->xAxisLabel = $label;
return $this; return $this;
} }
@ -295,7 +295,7 @@ class PHPExcel_Chart
*/ */
public function getYAxisLabel() public function getYAxisLabel()
{ {
return $this->_yAxisLabel; return $this->yAxisLabel;
} }
/** /**
@ -306,7 +306,7 @@ class 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;
} }
@ -318,7 +318,7 @@ class PHPExcel_Chart
*/ */
public function getPlotArea() public function getPlotArea()
{ {
return $this->_plotArea; return $this->plotArea;
} }
/** /**
@ -328,7 +328,7 @@ class PHPExcel_Chart
*/ */
public function getPlotVisibleOnly() public function getPlotVisibleOnly()
{ {
return $this->_plotVisibleOnly; return $this->plotVisibleOnly;
} }
/** /**
@ -339,7 +339,7 @@ class PHPExcel_Chart
*/ */
public function setPlotVisibleOnly($plotVisibleOnly = true) public function setPlotVisibleOnly($plotVisibleOnly = true)
{ {
$this->_plotVisibleOnly = $plotVisibleOnly; $this->plotVisibleOnly = $plotVisibleOnly;
return $this; return $this;
} }
@ -351,7 +351,7 @@ class PHPExcel_Chart
*/ */
public function getDisplayBlanksAs() public function getDisplayBlanksAs()
{ {
return $this->_displayBlanksAs; return $this->displayBlanksAs;
} }
/** /**
@ -362,7 +362,7 @@ class PHPExcel_Chart
*/ */
public function setDisplayBlanksAs($displayBlanksAs = '0') public function setDisplayBlanksAs($displayBlanksAs = '0')
{ {
$this->_displayBlanksAs = $displayBlanksAs; $this->displayBlanksAs = $displayBlanksAs;
} }
@ -373,8 +373,8 @@ class PHPExcel_Chart
*/ */
public function getChartAxisY() public function getChartAxisY()
{ {
if ($this->_yAxis !== null) { if ($this->yAxis !== null) {
return $this->_yAxis; return $this->yAxis;
} }
return new PHPExcel_Chart_Axis(); return new PHPExcel_Chart_Axis();
@ -387,8 +387,8 @@ class PHPExcel_Chart
*/ */
public function getChartAxisX() public function getChartAxisX()
{ {
if ($this->_xAxis !== null) { if ($this->xAxis !== null) {
return $this->_xAxis; return $this->xAxis;
} }
return new PHPExcel_Chart_Axis(); return new PHPExcel_Chart_Axis();
@ -401,8 +401,8 @@ class PHPExcel_Chart
*/ */
public function getMajorGridlines() public function getMajorGridlines()
{ {
if ($this->_majorGridlines !== null) { if ($this->majorGridlines !== null) {
return $this->_majorGridlines; return $this->majorGridlines;
} }
return new PHPExcel_Chart_GridLines(); return new PHPExcel_Chart_GridLines();
@ -415,8 +415,8 @@ class PHPExcel_Chart
*/ */
public function getMinorGridlines() public function getMinorGridlines()
{ {
if ($this->_minorGridlines !== null) { if ($this->minorGridlines !== null) {
return $this->_minorGridlines; return $this->minorGridlines;
} }
return new PHPExcel_Chart_GridLines(); return new PHPExcel_Chart_GridLines();
@ -433,7 +433,7 @@ class PHPExcel_Chart
*/ */
public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null) public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
{ {
$this->_topLeftCellRef = $cell; $this->topLeftCellRef = $cell;
if (!is_null($xOffset)) { if (!is_null($xOffset)) {
$this->setTopLeftXOffset($xOffset); $this->setTopLeftXOffset($xOffset);
} }
@ -452,9 +452,9 @@ class PHPExcel_Chart
public function getTopLeftPosition() public function getTopLeftPosition()
{ {
return array( return array(
'cell' => $this->_topLeftCellRef, 'cell' => $this->topLeftCellRef,
'xOffset' => $this->_topLeftXOffset, 'xOffset' => $this->topLeftXOffset,
'yOffset' => $this->_topLeftYOffset 'yOffset' => $this->topLeftYOffset
); );
} }
@ -465,7 +465,7 @@ class PHPExcel_Chart
*/ */
public function getTopLeftCell() public function getTopLeftCell()
{ {
return $this->_topLeftCellRef; return $this->topLeftCellRef;
} }
/** /**
@ -476,7 +476,7 @@ class PHPExcel_Chart
*/ */
public function setTopLeftCell($cell) public function setTopLeftCell($cell)
{ {
$this->_topLeftCellRef = $cell; $this->topLeftCellRef = $cell;
return $this; return $this;
} }
@ -508,33 +508,33 @@ class PHPExcel_Chart
public function getTopLeftOffset() public function getTopLeftOffset()
{ {
return array( return array(
'X' => $this->_topLeftXOffset, 'X' => $this->topLeftXOffset,
'Y' => $this->_topLeftYOffset 'Y' => $this->topLeftYOffset
); );
} }
public function setTopLeftXOffset($xOffset) public function setTopLeftXOffset($xOffset)
{ {
$this->_topLeftXOffset = $xOffset; $this->topLeftXOffset = $xOffset;
return $this; return $this;
} }
public function getTopLeftXOffset() public function getTopLeftXOffset()
{ {
return $this->_topLeftXOffset; return $this->topLeftXOffset;
} }
public function setTopLeftYOffset($yOffset) public function setTopLeftYOffset($yOffset)
{ {
$this->_topLeftYOffset = $yOffset; $this->topLeftYOffset = $yOffset;
return $this; return $this;
} }
public function getTopLeftYOffset() public function getTopLeftYOffset()
{ {
return $this->_topLeftYOffset; return $this->topLeftYOffset;
} }
/** /**
@ -547,7 +547,7 @@ class PHPExcel_Chart
*/ */
public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null) public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null)
{ {
$this->_bottomRightCellRef = $cell; $this->bottomRightCellRef = $cell;
if (!is_null($xOffset)) { if (!is_null($xOffset)) {
$this->setBottomRightXOffset($xOffset); $this->setBottomRightXOffset($xOffset);
} }
@ -566,15 +566,15 @@ class PHPExcel_Chart
public function getBottomRightPosition() public function getBottomRightPosition()
{ {
return array( return array(
'cell' => $this->_bottomRightCellRef, 'cell' => $this->bottomRightCellRef,
'xOffset' => $this->_bottomRightXOffset, 'xOffset' => $this->bottomRightXOffset,
'yOffset' => $this->_bottomRightYOffset 'yOffset' => $this->bottomRightYOffset
); );
} }
public function setBottomRightCell($cell) public function setBottomRightCell($cell)
{ {
$this->_bottomRightCellRef = $cell; $this->bottomRightCellRef = $cell;
return $this; return $this;
} }
@ -586,7 +586,7 @@ class PHPExcel_Chart
*/ */
public function getBottomRightCell() public function getBottomRightCell()
{ {
return $this->_bottomRightCellRef; return $this->bottomRightCellRef;
} }
/** /**
@ -616,40 +616,40 @@ class PHPExcel_Chart
public function getBottomRightOffset() public function getBottomRightOffset()
{ {
return array( return array(
'X' => $this->_bottomRightXOffset, 'X' => $this->bottomRightXOffset,
'Y' => $this->_bottomRightYOffset 'Y' => $this->bottomRightYOffset
); );
} }
public function setBottomRightXOffset($xOffset) public function setBottomRightXOffset($xOffset)
{ {
$this->_bottomRightXOffset = $xOffset; $this->bottomRightXOffset = $xOffset;
return $this; return $this;
} }
public function getBottomRightXOffset() public function getBottomRightXOffset()
{ {
return $this->_bottomRightXOffset; return $this->bottomRightXOffset;
} }
public function setBottomRightYOffset($yOffset) public function setBottomRightYOffset($yOffset)
{ {
$this->_bottomRightYOffset = $yOffset; $this->bottomRightYOffset = $yOffset;
return $this; return $this;
} }
public function getBottomRightYOffset() public function getBottomRightYOffset()
{ {
return $this->_bottomRightYOffset; return $this->bottomRightYOffset;
} }
public function refresh() public function refresh()
{ {
if ($this->_worksheet !== null) { if ($this->worksheet !== null) {
$this->_plotArea->refresh($this->_worksheet); $this->plotArea->refresh($this->worksheet);
} }
} }

View File

@ -32,63 +32,63 @@ class PHPExcel_Comment implements PHPExcel_IComparable
* *
* @var string * @var string
*/ */
private $_author; private $author;
/** /**
* Rich text comment * Rich text comment
* *
* @var PHPExcel_RichText * @var PHPExcel_RichText
*/ */
private $_text; private $text;
/** /**
* Comment width (CSS style, i.e. XXpx or YYpt) * Comment width (CSS style, i.e. XXpx or YYpt)
* *
* @var string * @var string
*/ */
private $_width = '96pt'; private $width = '96pt';
/** /**
* Left margin (CSS style, i.e. XXpx or YYpt) * Left margin (CSS style, i.e. XXpx or YYpt)
* *
* @var string * @var string
*/ */
private $_marginLeft = '59.25pt'; private $marginLeft = '59.25pt';
/** /**
* Top margin (CSS style, i.e. XXpx or YYpt) * Top margin (CSS style, i.e. XXpx or YYpt)
* *
* @var string * @var string
*/ */
private $_marginTop = '1.5pt'; private $marginTop = '1.5pt';
/** /**
* Visible * Visible
* *
* @var boolean * @var boolean
*/ */
private $_visible = false; private $visible = false;
/** /**
* Comment height (CSS style, i.e. XXpx or YYpt) * Comment height (CSS style, i.e. XXpx or YYpt)
* *
* @var string * @var string
*/ */
private $_height = '55.5pt'; private $height = '55.5pt';
/** /**
* Comment fill color * Comment fill color
* *
* @var PHPExcel_Style_Color * @var PHPExcel_Style_Color
*/ */
private $_fillColor; private $fillColor;
/** /**
* Alignment * Alignment
* *
* @var string * @var string
*/ */
private $_alignment; private $alignment;
/** /**
* Create a new PHPExcel_Comment * Create a new PHPExcel_Comment
@ -98,10 +98,10 @@ class PHPExcel_Comment implements PHPExcel_IComparable
public function __construct() public function __construct()
{ {
// Initialise variables // Initialise variables
$this->_author = 'Author'; $this->author = 'Author';
$this->_text = new PHPExcel_RichText(); $this->text = new PHPExcel_RichText();
$this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1'); $this->fillColor = new PHPExcel_Style_Color('FFFFFFE1');
$this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; $this->alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
} }
/** /**
@ -111,7 +111,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getAuthor() public function getAuthor()
{ {
return $this->_author; return $this->author;
} }
/** /**
@ -122,7 +122,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setAuthor($pValue = '') public function setAuthor($pValue = '')
{ {
$this->_author = $pValue; $this->author = $pValue;
return $this; return $this;
} }
@ -133,7 +133,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getText() public function getText()
{ {
return $this->_text; return $this->text;
} }
/** /**
@ -144,7 +144,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setText(PHPExcel_RichText $pValue) public function setText(PHPExcel_RichText $pValue)
{ {
$this->_text = $pValue; $this->text = $pValue;
return $this; return $this;
} }
@ -155,7 +155,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getWidth() public function getWidth()
{ {
return $this->_width; return $this->width;
} }
/** /**
@ -166,7 +166,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setWidth($value = '96pt') public function setWidth($value = '96pt')
{ {
$this->_width = $value; $this->width = $value;
return $this; return $this;
} }
@ -177,7 +177,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getHeight() public function getHeight()
{ {
return $this->_height; return $this->height;
} }
/** /**
@ -188,7 +188,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setHeight($value = '55.5pt') public function setHeight($value = '55.5pt')
{ {
$this->_height = $value; $this->height = $value;
return $this; return $this;
} }
@ -199,7 +199,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getMarginLeft() public function getMarginLeft()
{ {
return $this->_marginLeft; return $this->marginLeft;
} }
/** /**
@ -210,7 +210,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setMarginLeft($value = '59.25pt') public function setMarginLeft($value = '59.25pt')
{ {
$this->_marginLeft = $value; $this->marginLeft = $value;
return $this; return $this;
} }
@ -221,7 +221,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getMarginTop() public function getMarginTop()
{ {
return $this->_marginTop; return $this->marginTop;
} }
/** /**
@ -232,7 +232,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setMarginTop($value = '1.5pt') public function setMarginTop($value = '1.5pt')
{ {
$this->_marginTop = $value; $this->marginTop = $value;
return $this; return $this;
} }
@ -243,7 +243,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getVisible() public function getVisible()
{ {
return $this->_visible; return $this->visible;
} }
/** /**
@ -254,7 +254,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setVisible($value = false) public function setVisible($value = false)
{ {
$this->_visible = $value; $this->visible = $value;
return $this; return $this;
} }
@ -265,7 +265,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getFillColor() public function getFillColor()
{ {
return $this->_fillColor; return $this->fillColor;
} }
/** /**
@ -276,7 +276,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL)
{ {
$this->_alignment = $pValue; $this->alignment = $pValue;
return $this; return $this;
} }
@ -287,7 +287,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function getAlignment() public function getAlignment()
{ {
return $this->_alignment; return $this->alignment;
} }
/** /**
@ -298,16 +298,16 @@ class PHPExcel_Comment implements PHPExcel_IComparable
public function getHashCode() public function getHashCode()
{ {
return md5( return md5(
$this->_author $this->author .
. $this->_text->getHashCode() $this->text->getHashCode() .
. $this->_width $this->width .
. $this->_height $this->height .
. $this->_marginLeft $this->marginLeft .
. $this->_marginTop $this->marginTop .
. ($this->_visible ? 1 : 0) ($this->visible ? 1 : 0) .
. $this->_fillColor->getHashCode() $this->fillColor->getHashCode() .
. $this->_alignment $this->alignment .
. __CLASS__ __CLASS__
); );
} }
@ -333,6 +333,6 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/ */
public function __toString() public function __toString()
{ {
return $this->_text->getPlainText(); return $this->text->getPlainText();
} }
} }

View File

@ -40,84 +40,84 @@ class PHPExcel_DocumentProperties
* *
* @var string * @var string
*/ */
private $_creator = 'Unknown Creator'; private $creator = 'Unknown Creator';
/** /**
* LastModifiedBy * LastModifiedBy
* *
* @var string * @var string
*/ */
private $_lastModifiedBy; private $lastModifiedBy;
/** /**
* Created * Created
* *
* @var datetime * @var datetime
*/ */
private $_created; private $created;
/** /**
* Modified * Modified
* *
* @var datetime * @var datetime
*/ */
private $_modified; private $modified;
/** /**
* Title * Title
* *
* @var string * @var string
*/ */
private $_title = 'Untitled Spreadsheet'; private $title = 'Untitled Spreadsheet';
/** /**
* Description * Description
* *
* @var string * @var string
*/ */
private $_description = ''; private $description = '';
/** /**
* Subject * Subject
* *
* @var string * @var string
*/ */
private $_subject = ''; private $subject = '';
/** /**
* Keywords * Keywords
* *
* @var string * @var string
*/ */
private $_keywords = ''; private $keywords = '';
/** /**
* Category * Category
* *
* @var string * @var string
*/ */
private $_category = ''; private $category = '';
/** /**
* Manager * Manager
* *
* @var string * @var string
*/ */
private $_manager = ''; private $manager = '';
/** /**
* Company * Company
* *
* @var string * @var string
*/ */
private $_company = 'Microsoft Corporation'; private $company = 'Microsoft Corporation';
/** /**
* Custom Properties * Custom Properties
* *
* @var string * @var string
*/ */
private $_customProperties = array(); private $customProperties = array();
/** /**
@ -126,9 +126,9 @@ class PHPExcel_DocumentProperties
public function __construct() public function __construct()
{ {
// Initialise values // Initialise values
$this->_lastModifiedBy = $this->_creator; $this->lastModifiedBy = $this->creator;
$this->_created = time(); $this->created = time();
$this->_modified = time(); $this->modified = time();
} }
/** /**
@ -138,7 +138,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getCreator() public function getCreator()
{ {
return $this->_creator; return $this->creator;
} }
/** /**
@ -149,7 +149,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setCreator($pValue = '') public function setCreator($pValue = '')
{ {
$this->_creator = $pValue; $this->creator = $pValue;
return $this; return $this;
} }
@ -160,7 +160,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getLastModifiedBy() public function getLastModifiedBy()
{ {
return $this->_lastModifiedBy; return $this->lastModifiedBy;
} }
/** /**
@ -171,7 +171,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setLastModifiedBy($pValue = '') public function setLastModifiedBy($pValue = '')
{ {
$this->_lastModifiedBy = $pValue; $this->lastModifiedBy = $pValue;
return $this; return $this;
} }
@ -182,7 +182,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getCreated() public function getCreated()
{ {
return $this->_created; return $this->created;
} }
/** /**
@ -203,7 +203,7 @@ class PHPExcel_DocumentProperties
} }
} }
$this->_created = $pValue; $this->created = $pValue;
return $this; return $this;
} }
@ -214,7 +214,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getModified() public function getModified()
{ {
return $this->_modified; return $this->modified;
} }
/** /**
@ -235,7 +235,7 @@ class PHPExcel_DocumentProperties
} }
} }
$this->_modified = $pValue; $this->modified = $pValue;
return $this; return $this;
} }
@ -246,7 +246,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getTitle() public function getTitle()
{ {
return $this->_title; return $this->title;
} }
/** /**
@ -257,7 +257,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setTitle($pValue = '') public function setTitle($pValue = '')
{ {
$this->_title = $pValue; $this->title = $pValue;
return $this; return $this;
} }
@ -268,7 +268,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getDescription() public function getDescription()
{ {
return $this->_description; return $this->description;
} }
/** /**
@ -279,7 +279,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setDescription($pValue = '') public function setDescription($pValue = '')
{ {
$this->_description = $pValue; $this->description = $pValue;
return $this; return $this;
} }
@ -290,7 +290,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getSubject() public function getSubject()
{ {
return $this->_subject; return $this->subject;
} }
/** /**
@ -301,7 +301,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setSubject($pValue = '') public function setSubject($pValue = '')
{ {
$this->_subject = $pValue; $this->subject = $pValue;
return $this; return $this;
} }
@ -312,7 +312,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getKeywords() public function getKeywords()
{ {
return $this->_keywords; return $this->keywords;
} }
/** /**
@ -323,7 +323,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setKeywords($pValue = '') public function setKeywords($pValue = '')
{ {
$this->_keywords = $pValue; $this->keywords = $pValue;
return $this; return $this;
} }
@ -334,7 +334,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getCategory() public function getCategory()
{ {
return $this->_category; return $this->category;
} }
/** /**
@ -345,7 +345,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setCategory($pValue = '') public function setCategory($pValue = '')
{ {
$this->_category = $pValue; $this->category = $pValue;
return $this; return $this;
} }
@ -356,7 +356,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getCompany() public function getCompany()
{ {
return $this->_company; return $this->company;
} }
/** /**
@ -367,7 +367,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setCompany($pValue = '') public function setCompany($pValue = '')
{ {
$this->_company = $pValue; $this->company = $pValue;
return $this; return $this;
} }
@ -378,7 +378,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getManager() public function getManager()
{ {
return $this->_manager; return $this->manager;
} }
/** /**
@ -389,7 +389,7 @@ class PHPExcel_DocumentProperties
*/ */
public function setManager($pValue = '') public function setManager($pValue = '')
{ {
$this->_manager = $pValue; $this->manager = $pValue;
return $this; return $this;
} }
@ -400,7 +400,7 @@ class PHPExcel_DocumentProperties
*/ */
public function getCustomProperties() public function getCustomProperties()
{ {
return array_keys($this->_customProperties); return array_keys($this->customProperties);
} }
/** /**
@ -411,7 +411,7 @@ class PHPExcel_DocumentProperties
*/ */
public function isCustomPropertySet($propertyName) public function isCustomPropertySet($propertyName)
{ {
return isset($this->_customProperties[$propertyName]); return isset($this->customProperties[$propertyName]);
} }
/** /**
@ -422,8 +422,8 @@ class PHPExcel_DocumentProperties
*/ */
public function getCustomPropertyValue($propertyName) public function getCustomPropertyValue($propertyName)
{ {
if (isset($this->_customProperties[$propertyName])) { if (isset($this->customProperties[$propertyName])) {
return $this->_customProperties[$propertyName]['value']; return $this->customProperties[$propertyName]['value'];
} }
} }
@ -436,8 +436,8 @@ class PHPExcel_DocumentProperties
*/ */
public function getCustomPropertyType($propertyName) public function getCustomPropertyType($propertyName)
{ {
if (isset($this->_customProperties[$propertyName])) { if (isset($this->customProperties[$propertyName])) {
return $this->_customProperties[$propertyName]['type']; return $this->customProperties[$propertyName]['type'];
} }
} }
@ -475,7 +475,7 @@ class PHPExcel_DocumentProperties
} }
} }
$this->_customProperties[$propertyName] = array( $this->customProperties[$propertyName] = array(
'value' => $propertyValue, 'value' => $propertyValue,
'type' => $propertyType 'type' => $propertyType
); );

View File

@ -32,14 +32,14 @@ class PHPExcel_HashTable
* *
* @var array * @var array
*/ */
public $_items = array(); protected $items = array();
/** /**
* HashTable key map * HashTable key map
* *
* @var array * @var array
*/ */
public $_keyMap = array(); protected $keyMap = array();
/** /**
* Create a new PHPExcel_HashTable * Create a new PHPExcel_HashTable
@ -84,9 +84,9 @@ class PHPExcel_HashTable
public function add(PHPExcel_IComparable $pSource = null) public function add(PHPExcel_IComparable $pSource = null)
{ {
$hash = $pSource->getHashCode(); $hash = $pSource->getHashCode();
if (!isset($this->_items[$hash])) { if (!isset($this->items[$hash])) {
$this->_items[$hash] = $pSource; $this->items[$hash] = $pSource;
$this->_keyMap[count($this->_items) - 1] = $hash; $this->keyMap[count($this->items) - 1] = $hash;
} }
} }
@ -99,20 +99,20 @@ class PHPExcel_HashTable
public function remove(PHPExcel_IComparable $pSource = null) public function remove(PHPExcel_IComparable $pSource = null)
{ {
$hash = $pSource->getHashCode(); $hash = $pSource->getHashCode();
if (isset($this->_items[$hash])) { if (isset($this->items[$hash])) {
unset($this->_items[$hash]); unset($this->items[$hash]);
$deleteKey = -1; $deleteKey = -1;
foreach ($this->_keyMap as $key => $value) { foreach ($this->keyMap as $key => $value) {
if ($deleteKey >= 0) { if ($deleteKey >= 0) {
$this->_keyMap[$key - 1] = $value; $this->keyMap[$key - 1] = $value;
} }
if ($value == $hash) { if ($value == $hash) {
$deleteKey = $key; $deleteKey = $key;
} }
} }
unset($this->_keyMap[count($this->_keyMap) - 1]); unset($this->keyMap[count($this->keyMap) - 1]);
} }
} }
@ -122,8 +122,8 @@ class PHPExcel_HashTable
*/ */
public function clear() public function clear()
{ {
$this->_items = array(); $this->items = array();
$this->_keyMap = array(); $this->keyMap = array();
} }
/** /**
@ -133,7 +133,7 @@ class PHPExcel_HashTable
*/ */
public function count() public function count()
{ {
return count($this->_items); return count($this->items);
} }
/** /**
@ -144,7 +144,7 @@ class PHPExcel_HashTable
*/ */
public function getIndexForHashCode($pHashCode = '') public function getIndexForHashCode($pHashCode = '')
{ {
return array_search($pHashCode, $this->_keyMap); return array_search($pHashCode, $this->keyMap);
} }
/** /**
@ -156,8 +156,8 @@ class PHPExcel_HashTable
*/ */
public function getByIndex($pIndex = 0) public function getByIndex($pIndex = 0)
{ {
if (isset($this->_keyMap[$pIndex])) { if (isset($this->keyMap[$pIndex])) {
return $this->getByHashCode($this->_keyMap[$pIndex]); return $this->getByHashCode($this->keyMap[$pIndex]);
} }
return null; return null;
@ -172,8 +172,8 @@ class PHPExcel_HashTable
*/ */
public function getByHashCode($pHashCode = '') public function getByHashCode($pHashCode = '')
{ {
if (isset($this->_items[$pHashCode])) { if (isset($this->items[$pHashCode])) {
return $this->_items[$pHashCode]; return $this->items[$pHashCode];
} }
return null; return null;
@ -186,7 +186,7 @@ class PHPExcel_HashTable
*/ */
public function toArray() public function toArray()
{ {
return $this->_items; return $this->items;
} }
/** /**

View File

@ -25,14 +25,14 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Worksheet_ColumnDimension class PHPExcel_Worksheet_ColumnDimension extends PHPExcel_Worksheet_Dimension
{ {
/** /**
* Column index * Column index
* *
* @var int * @var int
*/ */
private $_columnIndex; private $columnIndex;
/** /**
* Column width * Column width
@ -41,42 +41,14 @@ class PHPExcel_Worksheet_ColumnDimension
* *
* @var double * @var double
*/ */
private $_width = -1; private $width = -1;
/** /**
* Auto size? * Auto size?
* *
* @var bool * @var bool
*/ */
private $_autoSize = false; private $autoSize = false;
/**
* Visible?
*
* @var bool
*/
private $_visible = true;
/**
* Outline level
*
* @var int
*/
private $_outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $_collapsed = false;
/**
* Index to cellXf
*
* @var int
*/
private $_xfIndex;
/** /**
* Create a new PHPExcel_Worksheet_ColumnDimension * Create a new PHPExcel_Worksheet_ColumnDimension
@ -86,10 +58,10 @@ class PHPExcel_Worksheet_ColumnDimension
public function __construct($pIndex = 'A') public function __construct($pIndex = 'A')
{ {
// Initialise values // Initialise values
$this->_columnIndex = $pIndex; $this->columnIndex = $pIndex;
// set default index to cellXf // set dimension as unformatted by default
$this->_xfIndex = 0; parent::__construct(0);
} }
/** /**
@ -99,7 +71,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/ */
public function getColumnIndex() public function getColumnIndex()
{ {
return $this->_columnIndex; return $this->columnIndex;
} }
/** /**
@ -110,7 +82,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/ */
public function setColumnIndex($pValue) public function setColumnIndex($pValue)
{ {
$this->_columnIndex = $pValue; $this->columnIndex = $pValue;
return $this; return $this;
} }
@ -121,7 +93,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/ */
public function getWidth() public function getWidth()
{ {
return $this->_width; return $this->width;
} }
/** /**
@ -132,7 +104,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/ */
public function setWidth($pValue = -1) public function setWidth($pValue = -1)
{ {
$this->_width = $pValue; $this->width = $pValue;
return $this; return $this;
} }
@ -143,7 +115,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/ */
public function getAutoSize() public function getAutoSize()
{ {
return $this->_autoSize; return $this->autoSize;
} }
/** /**
@ -154,117 +126,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/ */
public function setAutoSize($pValue = false) public function setAutoSize($pValue = false)
{ {
$this->_autoSize = $pValue; $this->autoSize = $pValue;
return $this; return $this;
} }
/**
* Get Visible
*
* @return bool
*/
public function getVisible()
{
return $this->_visible;
}
/**
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setVisible($pValue = true)
{
$this->_visible = $pValue;
return $this;
}
/**
* Get Outline Level
*
* @return int
*/
public function getOutlineLevel()
{
return $this->_outlineLevel;
}
/**
* Set Outline Level
*
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setOutlineLevel($pValue)
{
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}
$this->_outlineLevel = $pValue;
return $this;
}
/**
* Get Collapsed
*
* @return bool
*/
public function getCollapsed()
{
return $this->_collapsed;
}
/**
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setCollapsed($pValue = true)
{
$this->_collapsed = $pValue;
return $this;
}
/**
* Get index to cellXf
*
* @return int
*/
public function getXfIndex()
{
return $this->_xfIndex;
}
/**
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setXfIndex($pValue = 0)
{
$this->_xfIndex = $pValue;
return $this;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
public function __clone()
{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
} }

View File

@ -0,0 +1,178 @@
<?php
/**
* PHPExcel_Worksheet_Dimension
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_Worksheet_Dimension
{
/**
* Visible?
*
* @var bool
*/
private $visible = true;
/**
* Outline level
*
* @var int
*/
private $outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $collapsed = false;
/**
* Index to cellXf. Null value means row has no explicit cellXf format.
*
* @var int|null
*/
private $xfIndex;
/**
* Create a new PHPExcel_Worksheet_Dimension
*
* @param int $pIndex Numeric row index
*/
public function __construct($initialValue = null)
{
// set dimension as unformatted by default
$this->xfIndex = $initialValue;
}
/**
* Get Visible
*
* @return bool
*/
public function getVisible()
{
return $this->visible;
}
/**
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_Dimension
*/
public function setVisible($pValue = true)
{
$this->visible = $pValue;
return $this;
}
/**
* Get Outline Level
*
* @return int
*/
public function getOutlineLevel()
{
return $this->outlineLevel;
}
/**
* Set Outline Level
*
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_Dimension
*/
public function setOutlineLevel($pValue)
{
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}
$this->outlineLevel = $pValue;
return $this;
}
/**
* Get Collapsed
*
* @return bool
*/
public function getCollapsed()
{
return $this->collapsed;
}
/**
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_Dimension
*/
public function setCollapsed($pValue = true)
{
$this->collapsed = $pValue;
return $this;
}
/**
* Get index to cellXf
*
* @return int
*/
public function getXfIndex()
{
return $this->xfIndex;
}
/**
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_Dimension
*/
public function setXfIndex($pValue = 0)
{
$this->xfIndex = $pValue;
return $this;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
public function __clone()
{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
}

View File

@ -25,14 +25,14 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
class PHPExcel_Worksheet_RowDimension class PHPExcel_Worksheet_RowDimension extends PHPExcel_Worksheet_Dimension
{ {
/** /**
* Row index * Row index
* *
* @var int * @var int
*/ */
private $_rowIndex; private $rowIndex;
/** /**
* Row height (in pt) * Row height (in pt)
@ -41,42 +41,14 @@ class PHPExcel_Worksheet_RowDimension
* *
* @var double * @var double
*/ */
private $_rowHeight = -1; private $height = -1;
/** /**
* ZeroHeight for Row? * ZeroHeight for Row?
* *
* @var bool * @var bool
*/ */
private $_zeroHeight = false; private $zeroHeight = false;
/**
* Visible?
*
* @var bool
*/
private $_visible = true;
/**
* Outline level
*
* @var int
*/
private $_outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $_collapsed = false;
/**
* Index to cellXf. Null value means row has no explicit cellXf format.
*
* @var int|null
*/
private $_xfIndex;
/** /**
* Create a new PHPExcel_Worksheet_RowDimension * Create a new PHPExcel_Worksheet_RowDimension
@ -86,10 +58,10 @@ class PHPExcel_Worksheet_RowDimension
public function __construct($pIndex = 0) public function __construct($pIndex = 0)
{ {
// Initialise values // Initialise values
$this->_rowIndex = $pIndex; $this->rowIndex = $pIndex;
// set row dimension as unformatted by default // set dimension as unformatted by default
$this->_xfIndex = null; parent::__construct(null);
} }
/** /**
@ -99,7 +71,7 @@ class PHPExcel_Worksheet_RowDimension
*/ */
public function getRowIndex() public function getRowIndex()
{ {
return $this->_rowIndex; return $this->rowIndex;
} }
/** /**
@ -110,7 +82,7 @@ class PHPExcel_Worksheet_RowDimension
*/ */
public function setRowIndex($pValue) public function setRowIndex($pValue)
{ {
$this->_rowIndex = $pValue; $this->rowIndex = $pValue;
return $this; return $this;
} }
@ -121,7 +93,7 @@ class PHPExcel_Worksheet_RowDimension
*/ */
public function getRowHeight() public function getRowHeight()
{ {
return $this->_rowHeight; return $this->height;
} }
/** /**
@ -132,7 +104,7 @@ class PHPExcel_Worksheet_RowDimension
*/ */
public function setRowHeight($pValue = -1) public function setRowHeight($pValue = -1)
{ {
$this->_rowHeight = $pValue; $this->height = $pValue;
return $this; return $this;
} }
@ -143,7 +115,7 @@ class PHPExcel_Worksheet_RowDimension
*/ */
public function getZeroHeight() public function getZeroHeight()
{ {
return $this->_zeroHeight; return $this->zeroHeight;
} }
/** /**
@ -154,117 +126,7 @@ class PHPExcel_Worksheet_RowDimension
*/ */
public function setZeroHeight($pValue = false) public function setZeroHeight($pValue = false)
{ {
$this->_zeroHeight = $pValue; $this->zeroHeight = $pValue;
return $this; return $this;
} }
/**
* Get Visible
*
* @return bool
*/
public function getVisible()
{
return $this->_visible;
}
/**
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
*/
public function setVisible($pValue = true)
{
$this->_visible = $pValue;
return $this;
}
/**
* Get Outline Level
*
* @return int
*/
public function getOutlineLevel()
{
return $this->_outlineLevel;
}
/**
* Set Outline Level
*
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_RowDimension
*/
public function setOutlineLevel($pValue)
{
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}
$this->_outlineLevel = $pValue;
return $this;
}
/**
* Get Collapsed
*
* @return bool
*/
public function getCollapsed()
{
return $this->_collapsed;
}
/**
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
*/
public function setCollapsed($pValue = true)
{
$this->_collapsed = $pValue;
return $this;
}
/**
* Get index to cellXf
*
* @return int
*/
public function getXfIndex()
{
return $this->_xfIndex;
}
/**
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_RowDimension
*/
public function setXfIndex($pValue = 0)
{
$this->_xfIndex = $pValue;
return $this;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
public function __clone()
{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Worksheet_SheetView
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,22 +25,13 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_Worksheet_SheetView
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Worksheet_SheetView class PHPExcel_Worksheet_SheetView
{ {
/* Sheet View types */ /* Sheet View types */
const SHEETVIEW_NORMAL = 'normal'; const SHEETVIEW_NORMAL = 'normal';
const SHEETVIEW_PAGE_LAYOUT = 'pageLayout'; const SHEETVIEW_PAGE_LAYOUT = 'pageLayout';
const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview'; const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview';
private static $_sheetViewTypes = array( private static $_sheetViewTypes = array(
self::SHEETVIEW_NORMAL, self::SHEETVIEW_NORMAL,
@ -54,7 +46,7 @@ class PHPExcel_Worksheet_SheetView
* *
* @var int * @var int
*/ */
private $_zoomScale = 100; private $zoomScale = 100;
/** /**
* ZoomScaleNormal * ZoomScaleNormal
@ -63,7 +55,7 @@ class PHPExcel_Worksheet_SheetView
* *
* @var int * @var int
*/ */
private $_zoomScaleNormal = 100; private $zoomScaleNormal = 100;
/** /**
* View * View
@ -72,7 +64,7 @@ class PHPExcel_Worksheet_SheetView
* *
* @var string * @var string
*/ */
private $_sheetviewType = self::SHEETVIEW_NORMAL; private $sheetviewType = self::SHEETVIEW_NORMAL;
/** /**
* Create a new PHPExcel_Worksheet_SheetView * Create a new PHPExcel_Worksheet_SheetView
@ -88,7 +80,7 @@ class PHPExcel_Worksheet_SheetView
*/ */
public function getZoomScale() public function getZoomScale()
{ {
return $this->_zoomScale; return $this->zoomScale;
} }
/** /**
@ -105,7 +97,7 @@ class PHPExcel_Worksheet_SheetView
// 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)) {
$this->_zoomScale = $pValue; $this->zoomScale = $pValue;
} else { } else {
throw new PHPExcel_Exception("Scale must be greater than or equal to 1."); throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
} }
@ -119,7 +111,7 @@ class PHPExcel_Worksheet_SheetView
*/ */
public function getZoomScaleNormal() public function getZoomScaleNormal()
{ {
return $this->_zoomScaleNormal; return $this->zoomScaleNormal;
} }
/** /**
@ -134,7 +126,7 @@ class 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 {
throw new PHPExcel_Exception("Scale must be greater than or equal to 1."); throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
} }
@ -148,7 +140,7 @@ class PHPExcel_Worksheet_SheetView
*/ */
public function getView() public function getView()
{ {
return $this->_sheetviewType; return $this->sheetviewType;
} }
/** /**
@ -157,7 +149,7 @@ class PHPExcel_Worksheet_SheetView
* Valid values are * Valid values are
* 'normal' self::SHEETVIEW_NORMAL * 'normal' self::SHEETVIEW_NORMAL
* 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT * 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT
* 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW * 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
* *
* @param string $pValue * @param string $pValue
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
@ -170,7 +162,7 @@ class PHPExcel_Worksheet_SheetView
$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 {
throw new PHPExcel_Exception("Invalid sheetview layout type."); throw new PHPExcel_Exception("Invalid sheetview layout type.");
} }