Merge branch 'psr2' into develop
This commit is contained in:
commit
f94dcb9852
File diff suppressed because it is too large
Load Diff
|
@ -126,7 +126,7 @@ class PHPExcel_Calculation_Database
|
|||
$k = array_search($criteriaName, $fieldNames);
|
||||
if (isset($dataValues[$k])) {
|
||||
$dataValue = $dataValues[$k];
|
||||
$dataValue = (is_string($dataValue)) ? PHPExcel_Calculation::_wrapResult(strtoupper($dataValue)) : $dataValue;
|
||||
$dataValue = (is_string($dataValue)) ? PHPExcel_Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
|
||||
$testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ class PHPExcel_Calculation_Functions
|
|||
}
|
||||
if (!in_array($condition{0}, array('>', '<', '='))) {
|
||||
if (!is_numeric($condition)) {
|
||||
$condition = PHPExcel_Calculation::_wrapResult(strtoupper($condition));
|
||||
$condition = PHPExcel_Calculation::wrapResult(strtoupper($condition));
|
||||
}
|
||||
return '=' . $condition;
|
||||
} else {
|
||||
|
@ -332,7 +332,7 @@ class PHPExcel_Calculation_Functions
|
|||
|
||||
if (!is_numeric($operand)) {
|
||||
$operand = str_replace('"', '""', $operand);
|
||||
$operand = PHPExcel_Calculation::_wrapResult(strtoupper($operand));
|
||||
$operand = PHPExcel_Calculation::wrapResult(strtoupper($operand));
|
||||
}
|
||||
|
||||
return $operator.$operand;
|
||||
|
|
|
@ -1206,7 +1206,7 @@ class PHPExcel_Calculation_MathTrig
|
|||
foreach ($aArgs as $key => $arg) {
|
||||
if (!is_numeric($arg)) {
|
||||
$arg = str_replace('"', '""', $arg);
|
||||
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg));
|
||||
$arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
|
||||
}
|
||||
|
||||
$testCondition = '='.$arg.$condition;
|
||||
|
|
|
@ -877,7 +877,7 @@ class PHPExcel_Calculation_Statistical
|
|||
$aCount = 0;
|
||||
foreach ($aArgs as $key => $arg) {
|
||||
if (!is_numeric($arg)) {
|
||||
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg));
|
||||
$arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
|
||||
}
|
||||
$testCondition = '='.$arg.$condition;
|
||||
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
|
||||
|
@ -1298,7 +1298,7 @@ class PHPExcel_Calculation_Statistical
|
|||
// Loop through arguments
|
||||
foreach ($aArgs as $arg) {
|
||||
if (!is_numeric($arg)) {
|
||||
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg));
|
||||
$arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
|
||||
}
|
||||
$testCondition = '='.$arg.$condition;
|
||||
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
|
||||
|
@ -2290,7 +2290,7 @@ class PHPExcel_Calculation_Statistical
|
|||
// Loop through arguments
|
||||
foreach ($aArgs as $key => $arg) {
|
||||
if (!is_numeric($arg)) {
|
||||
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg));
|
||||
$arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
|
||||
}
|
||||
$testCondition = '='.$arg.$condition;
|
||||
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
|
||||
|
@ -2449,7 +2449,7 @@ class PHPExcel_Calculation_Statistical
|
|||
// Loop through arguments
|
||||
foreach ($aArgs as $key => $arg) {
|
||||
if (!is_numeric($arg)) {
|
||||
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg));
|
||||
$arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
|
||||
}
|
||||
$testCondition = '='.$arg.$condition;
|
||||
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
class PHPExcel_Cell
|
||||
{
|
||||
|
||||
/**
|
||||
* Default range variable constant
|
||||
*
|
||||
|
@ -227,6 +226,7 @@ class PHPExcel_Cell
|
|||
break;
|
||||
case PHPExcel_Cell_DataType::TYPE_STRING2:
|
||||
$pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
|
||||
// no break
|
||||
case PHPExcel_Cell_DataType::TYPE_STRING:
|
||||
// Synonym for string
|
||||
case PHPExcel_Cell_DataType::TYPE_INLINE:
|
||||
|
|
|
@ -32,98 +32,98 @@ class PHPExcel_Chart
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_name = '';
|
||||
private $name = '';
|
||||
|
||||
/**
|
||||
* Worksheet
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
*/
|
||||
private $_worksheet = null;
|
||||
private $worksheet;
|
||||
|
||||
/**
|
||||
* Chart Title
|
||||
*
|
||||
* @var PHPExcel_Chart_Title
|
||||
*/
|
||||
private $_title = null;
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* Chart Legend
|
||||
*
|
||||
* @var PHPExcel_Chart_Legend
|
||||
*/
|
||||
private $_legend = null;
|
||||
private $legend;
|
||||
|
||||
/**
|
||||
* X-Axis Label
|
||||
*
|
||||
* @var PHPExcel_Chart_Title
|
||||
*/
|
||||
private $_xAxisLabel = null;
|
||||
private $xAxisLabel;
|
||||
|
||||
/**
|
||||
* Y-Axis Label
|
||||
*
|
||||
* @var PHPExcel_Chart_Title
|
||||
*/
|
||||
private $_yAxisLabel = null;
|
||||
private $yAxisLabel;
|
||||
|
||||
/**
|
||||
* Chart Plot Area
|
||||
*
|
||||
* @var PHPExcel_Chart_PlotArea
|
||||
*/
|
||||
private $_plotArea = null;
|
||||
private $plotArea;
|
||||
|
||||
/**
|
||||
* Plot Visible Only
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_plotVisibleOnly = true;
|
||||
private $plotVisibleOnly = true;
|
||||
|
||||
/**
|
||||
* Display Blanks as
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_displayBlanksAs = '0';
|
||||
private $displayBlanksAs = '0';
|
||||
|
||||
/**
|
||||
* Chart Asix Y as
|
||||
*
|
||||
* @var PHPExcel_Chart_Axis
|
||||
*/
|
||||
private $_yAxis = null;
|
||||
private $yAxis;
|
||||
|
||||
/**
|
||||
* Chart Asix X as
|
||||
*
|
||||
* @var PHPExcel_Chart_Axis
|
||||
*/
|
||||
private $_xAxis = null;
|
||||
private $xAxis;
|
||||
|
||||
/**
|
||||
* Chart Major Gridlines as
|
||||
*
|
||||
* @var PHPExcel_Chart_GridLines
|
||||
*/
|
||||
private $_majorGridlines = null;
|
||||
private $majorGridlines;
|
||||
|
||||
/**
|
||||
* Chart Minor Gridlines as
|
||||
*
|
||||
* @var PHPExcel_Chart_GridLines
|
||||
*/
|
||||
private $_minorGridlines = null;
|
||||
private $minorGridlines;
|
||||
|
||||
/**
|
||||
* Top-Left Cell Position
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_topLeftCellRef = 'A1';
|
||||
private $topLeftCellRef = 'A1';
|
||||
|
||||
|
||||
/**
|
||||
|
@ -131,7 +131,7 @@ class PHPExcel_Chart
|
|||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $_topLeftXOffset = 0;
|
||||
private $topLeftXOffset = 0;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -139,7 +139,7 @@ class PHPExcel_Chart
|
|||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $_topLeftYOffset = 0;
|
||||
private $topLeftYOffset = 0;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -147,7 +147,7 @@ class PHPExcel_Chart
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_bottomRightCellRef = 'A1';
|
||||
private $bottomRightCellRef = 'A1';
|
||||
|
||||
|
||||
/**
|
||||
|
@ -155,7 +155,7 @@ class PHPExcel_Chart
|
|||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $_bottomRightXOffset = 10;
|
||||
private $bottomRightXOffset = 10;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,7 @@ class PHPExcel_Chart
|
|||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $_bottomRightYOffset = 10;
|
||||
private $bottomRightYOffset = 10;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -171,18 +171,18 @@ 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)
|
||||
{
|
||||
$this->_name = $name;
|
||||
$this->_title = $title;
|
||||
$this->_legend = $legend;
|
||||
$this->_xAxisLabel = $xAxisLabel;
|
||||
$this->_yAxisLabel = $yAxisLabel;
|
||||
$this->_plotArea = $plotArea;
|
||||
$this->_plotVisibleOnly = $plotVisibleOnly;
|
||||
$this->_displayBlanksAs = $displayBlanksAs;
|
||||
$this->_xAxis = $xAxis;
|
||||
$this->_yAxis = $yAxis;
|
||||
$this->_majorGridlines = $majorGridlines;
|
||||
$this->_minorGridlines = $minorGridlines;
|
||||
$this->name = $name;
|
||||
$this->title = $title;
|
||||
$this->legend = $legend;
|
||||
$this->xAxisLabel = $xAxisLabel;
|
||||
$this->yAxisLabel = $yAxisLabel;
|
||||
$this->plotArea = $plotArea;
|
||||
$this->plotVisibleOnly = $plotVisibleOnly;
|
||||
$this->displayBlanksAs = $displayBlanksAs;
|
||||
$this->xAxis = $xAxis;
|
||||
$this->yAxis = $yAxis;
|
||||
$this->majorGridlines = $majorGridlines;
|
||||
$this->minorGridlines = $minorGridlines;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -192,7 +192,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -202,7 +202,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getWorksheet()
|
||||
{
|
||||
return $this->_worksheet;
|
||||
return $this->worksheet;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -214,7 +214,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setWorksheet(PHPExcel_Worksheet $pValue = null)
|
||||
{
|
||||
$this->_worksheet = $pValue;
|
||||
$this->worksheet = $pValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->_title;
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -237,7 +237,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setTitle(PHPExcel_Chart_Title $title)
|
||||
{
|
||||
$this->_title = $title;
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getLegend()
|
||||
{
|
||||
return $this->_legend;
|
||||
return $this->legend;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -260,7 +260,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setLegend(PHPExcel_Chart_Legend $legend)
|
||||
{
|
||||
$this->_legend = $legend;
|
||||
$this->legend = $legend;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getXAxisLabel()
|
||||
{
|
||||
return $this->_xAxisLabel;
|
||||
return $this->xAxisLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -283,7 +283,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setXAxisLabel(PHPExcel_Chart_Title $label)
|
||||
{
|
||||
$this->_xAxisLabel = $label;
|
||||
$this->xAxisLabel = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getYAxisLabel()
|
||||
{
|
||||
return $this->_yAxisLabel;
|
||||
return $this->yAxisLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -306,7 +306,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setYAxisLabel(PHPExcel_Chart_Title $label)
|
||||
{
|
||||
$this->_yAxisLabel = $label;
|
||||
$this->yAxisLabel = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getPlotArea()
|
||||
{
|
||||
return $this->_plotArea;
|
||||
return $this->plotArea;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -328,7 +328,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getPlotVisibleOnly()
|
||||
{
|
||||
return $this->_plotVisibleOnly;
|
||||
return $this->plotVisibleOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -339,7 +339,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setPlotVisibleOnly($plotVisibleOnly = true)
|
||||
{
|
||||
$this->_plotVisibleOnly = $plotVisibleOnly;
|
||||
$this->plotVisibleOnly = $plotVisibleOnly;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getDisplayBlanksAs()
|
||||
{
|
||||
return $this->_displayBlanksAs;
|
||||
return $this->displayBlanksAs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -362,7 +362,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setDisplayBlanksAs($displayBlanksAs = '0')
|
||||
{
|
||||
$this->_displayBlanksAs = $displayBlanksAs;
|
||||
$this->displayBlanksAs = $displayBlanksAs;
|
||||
}
|
||||
|
||||
|
||||
|
@ -373,8 +373,8 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getChartAxisY()
|
||||
{
|
||||
if ($this->_yAxis !== null) {
|
||||
return $this->_yAxis;
|
||||
if ($this->yAxis !== null) {
|
||||
return $this->yAxis;
|
||||
}
|
||||
|
||||
return new PHPExcel_Chart_Axis();
|
||||
|
@ -387,8 +387,8 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getChartAxisX()
|
||||
{
|
||||
if ($this->_xAxis !== null) {
|
||||
return $this->_xAxis;
|
||||
if ($this->xAxis !== null) {
|
||||
return $this->xAxis;
|
||||
}
|
||||
|
||||
return new PHPExcel_Chart_Axis();
|
||||
|
@ -401,8 +401,8 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getMajorGridlines()
|
||||
{
|
||||
if ($this->_majorGridlines !== null) {
|
||||
return $this->_majorGridlines;
|
||||
if ($this->majorGridlines !== null) {
|
||||
return $this->majorGridlines;
|
||||
}
|
||||
|
||||
return new PHPExcel_Chart_GridLines();
|
||||
|
@ -415,8 +415,8 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getMinorGridlines()
|
||||
{
|
||||
if ($this->_minorGridlines !== null) {
|
||||
return $this->_minorGridlines;
|
||||
if ($this->minorGridlines !== null) {
|
||||
return $this->minorGridlines;
|
||||
}
|
||||
|
||||
return new PHPExcel_Chart_GridLines();
|
||||
|
@ -433,7 +433,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
|
||||
{
|
||||
$this->_topLeftCellRef = $cell;
|
||||
$this->topLeftCellRef = $cell;
|
||||
if (!is_null($xOffset)) {
|
||||
$this->setTopLeftXOffset($xOffset);
|
||||
}
|
||||
|
@ -452,9 +452,9 @@ class PHPExcel_Chart
|
|||
public function getTopLeftPosition()
|
||||
{
|
||||
return array(
|
||||
'cell' => $this->_topLeftCellRef,
|
||||
'xOffset' => $this->_topLeftXOffset,
|
||||
'yOffset' => $this->_topLeftYOffset
|
||||
'cell' => $this->topLeftCellRef,
|
||||
'xOffset' => $this->topLeftXOffset,
|
||||
'yOffset' => $this->topLeftYOffset
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getTopLeftCell()
|
||||
{
|
||||
return $this->_topLeftCellRef;
|
||||
return $this->topLeftCellRef;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -476,7 +476,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setTopLeftCell($cell)
|
||||
{
|
||||
$this->_topLeftCellRef = $cell;
|
||||
$this->topLeftCellRef = $cell;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -508,33 +508,33 @@ class PHPExcel_Chart
|
|||
public function getTopLeftOffset()
|
||||
{
|
||||
return array(
|
||||
'X' => $this->_topLeftXOffset,
|
||||
'Y' => $this->_topLeftYOffset
|
||||
'X' => $this->topLeftXOffset,
|
||||
'Y' => $this->topLeftYOffset
|
||||
);
|
||||
}
|
||||
|
||||
public function setTopLeftXOffset($xOffset)
|
||||
{
|
||||
$this->_topLeftXOffset = $xOffset;
|
||||
$this->topLeftXOffset = $xOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTopLeftXOffset()
|
||||
{
|
||||
return $this->_topLeftXOffset;
|
||||
return $this->topLeftXOffset;
|
||||
}
|
||||
|
||||
public function setTopLeftYOffset($yOffset)
|
||||
{
|
||||
$this->_topLeftYOffset = $yOffset;
|
||||
$this->topLeftYOffset = $yOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTopLeftYOffset()
|
||||
{
|
||||
return $this->_topLeftYOffset;
|
||||
return $this->topLeftYOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -547,7 +547,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null)
|
||||
{
|
||||
$this->_bottomRightCellRef = $cell;
|
||||
$this->bottomRightCellRef = $cell;
|
||||
if (!is_null($xOffset)) {
|
||||
$this->setBottomRightXOffset($xOffset);
|
||||
}
|
||||
|
@ -566,15 +566,15 @@ class PHPExcel_Chart
|
|||
public function getBottomRightPosition()
|
||||
{
|
||||
return array(
|
||||
'cell' => $this->_bottomRightCellRef,
|
||||
'xOffset' => $this->_bottomRightXOffset,
|
||||
'yOffset' => $this->_bottomRightYOffset
|
||||
'cell' => $this->bottomRightCellRef,
|
||||
'xOffset' => $this->bottomRightXOffset,
|
||||
'yOffset' => $this->bottomRightYOffset
|
||||
);
|
||||
}
|
||||
|
||||
public function setBottomRightCell($cell)
|
||||
{
|
||||
$this->_bottomRightCellRef = $cell;
|
||||
$this->bottomRightCellRef = $cell;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -586,7 +586,7 @@ class PHPExcel_Chart
|
|||
*/
|
||||
public function getBottomRightCell()
|
||||
{
|
||||
return $this->_bottomRightCellRef;
|
||||
return $this->bottomRightCellRef;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -616,40 +616,40 @@ class PHPExcel_Chart
|
|||
public function getBottomRightOffset()
|
||||
{
|
||||
return array(
|
||||
'X' => $this->_bottomRightXOffset,
|
||||
'Y' => $this->_bottomRightYOffset
|
||||
'X' => $this->bottomRightXOffset,
|
||||
'Y' => $this->bottomRightYOffset
|
||||
);
|
||||
}
|
||||
|
||||
public function setBottomRightXOffset($xOffset)
|
||||
{
|
||||
$this->_bottomRightXOffset = $xOffset;
|
||||
$this->bottomRightXOffset = $xOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBottomRightXOffset()
|
||||
{
|
||||
return $this->_bottomRightXOffset;
|
||||
return $this->bottomRightXOffset;
|
||||
}
|
||||
|
||||
public function setBottomRightYOffset($yOffset)
|
||||
{
|
||||
$this->_bottomRightYOffset = $yOffset;
|
||||
$this->bottomRightYOffset = $yOffset;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBottomRightYOffset()
|
||||
{
|
||||
return $this->_bottomRightYOffset;
|
||||
return $this->bottomRightYOffset;
|
||||
}
|
||||
|
||||
|
||||
public function refresh()
|
||||
{
|
||||
if ($this->_worksheet !== null) {
|
||||
$this->_plotArea->refresh($this->_worksheet);
|
||||
if ($this->worksheet !== null) {
|
||||
$this->plotArea->refresh($this->worksheet);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ class PHPExcel_Chart_DataSeriesValues
|
|||
{
|
||||
if ($this->dataSource !== null) {
|
||||
$calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent());
|
||||
$newDataValues = PHPExcel_Calculation::_unwrapResult(
|
||||
$newDataValues = PHPExcel_Calculation::unwrapResult(
|
||||
$calcEngine->_calculateFormulaValue(
|
||||
'='.$this->dataSource,
|
||||
null,
|
||||
|
|
|
@ -32,63 +32,63 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_author;
|
||||
private $author;
|
||||
|
||||
/**
|
||||
* Rich text comment
|
||||
*
|
||||
* @var PHPExcel_RichText
|
||||
*/
|
||||
private $_text;
|
||||
private $text;
|
||||
|
||||
/**
|
||||
* Comment width (CSS style, i.e. XXpx or YYpt)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_width = '96pt';
|
||||
private $width = '96pt';
|
||||
|
||||
/**
|
||||
* Left margin (CSS style, i.e. XXpx or YYpt)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_marginLeft = '59.25pt';
|
||||
private $marginLeft = '59.25pt';
|
||||
|
||||
/**
|
||||
* Top margin (CSS style, i.e. XXpx or YYpt)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_marginTop = '1.5pt';
|
||||
private $marginTop = '1.5pt';
|
||||
|
||||
/**
|
||||
* Visible
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_visible = false;
|
||||
private $visible = false;
|
||||
|
||||
/**
|
||||
* Comment height (CSS style, i.e. XXpx or YYpt)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_height = '55.5pt';
|
||||
private $height = '55.5pt';
|
||||
|
||||
/**
|
||||
* Comment fill color
|
||||
*
|
||||
* @var PHPExcel_Style_Color
|
||||
*/
|
||||
private $_fillColor;
|
||||
private $fillColor;
|
||||
|
||||
/**
|
||||
* Alignment
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_alignment;
|
||||
private $alignment;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Comment
|
||||
|
@ -98,10 +98,10 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
public function __construct()
|
||||
{
|
||||
// Initialise variables
|
||||
$this->_author = 'Author';
|
||||
$this->_text = new PHPExcel_RichText();
|
||||
$this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1');
|
||||
$this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
|
||||
$this->author = 'Author';
|
||||
$this->text = new PHPExcel_RichText();
|
||||
$this->fillColor = new PHPExcel_Style_Color('FFFFFFE1');
|
||||
$this->alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,7 +111,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function getAuthor()
|
||||
{
|
||||
return $this->_author;
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -122,7 +122,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function setAuthor($pValue = '')
|
||||
{
|
||||
$this->_author = $pValue;
|
||||
$this->author = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
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)
|
||||
{
|
||||
$this->_text = $pValue;
|
||||
$this->text = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->_width;
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -166,7 +166,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function setWidth($value = '96pt')
|
||||
{
|
||||
$this->_width = $value;
|
||||
$this->width = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
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')
|
||||
{
|
||||
$this->_height = $value;
|
||||
$this->height = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
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')
|
||||
{
|
||||
$this->_marginLeft = $value;
|
||||
$this->marginLeft = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
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')
|
||||
{
|
||||
$this->_marginTop = $value;
|
||||
$this->marginTop = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function getVisible()
|
||||
{
|
||||
return $this->_visible;
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -254,7 +254,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function setVisible($value = false)
|
||||
{
|
||||
$this->_visible = $value;
|
||||
$this->visible = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
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)
|
||||
{
|
||||
$this->_alignment = $pValue;
|
||||
$this->alignment = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function getAlignment()
|
||||
{
|
||||
return $this->_alignment;
|
||||
return $this->alignment;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -298,16 +298,16 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
public function getHashCode()
|
||||
{
|
||||
return md5(
|
||||
$this->_author
|
||||
. $this->_text->getHashCode()
|
||||
. $this->_width
|
||||
. $this->_height
|
||||
. $this->_marginLeft
|
||||
. $this->_marginTop
|
||||
. ($this->_visible ? 1 : 0)
|
||||
. $this->_fillColor->getHashCode()
|
||||
. $this->_alignment
|
||||
. __CLASS__
|
||||
$this->author .
|
||||
$this->text->getHashCode() .
|
||||
$this->width .
|
||||
$this->height .
|
||||
$this->marginLeft .
|
||||
$this->marginTop .
|
||||
($this->visible ? 1 : 0) .
|
||||
$this->fillColor->getHashCode() .
|
||||
$this->alignment .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -333,6 +333,6 @@ class PHPExcel_Comment implements PHPExcel_IComparable
|
|||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->_text->getPlainText();
|
||||
return $this->text->getPlainText();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,84 +40,84 @@ class PHPExcel_DocumentProperties
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_creator = 'Unknown Creator';
|
||||
private $creator = 'Unknown Creator';
|
||||
|
||||
/**
|
||||
* LastModifiedBy
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_lastModifiedBy;
|
||||
private $lastModifiedBy;
|
||||
|
||||
/**
|
||||
* Created
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
private $_created;
|
||||
private $created;
|
||||
|
||||
/**
|
||||
* Modified
|
||||
*
|
||||
* @var datetime
|
||||
*/
|
||||
private $_modified;
|
||||
private $modified;
|
||||
|
||||
/**
|
||||
* Title
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_title = 'Untitled Spreadsheet';
|
||||
private $title = 'Untitled Spreadsheet';
|
||||
|
||||
/**
|
||||
* Description
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_description = '';
|
||||
private $description = '';
|
||||
|
||||
/**
|
||||
* Subject
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_subject = '';
|
||||
private $subject = '';
|
||||
|
||||
/**
|
||||
* Keywords
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_keywords = '';
|
||||
private $keywords = '';
|
||||
|
||||
/**
|
||||
* Category
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_category = '';
|
||||
private $category = '';
|
||||
|
||||
/**
|
||||
* Manager
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_manager = '';
|
||||
private $manager = '';
|
||||
|
||||
/**
|
||||
* Company
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_company = 'Microsoft Corporation';
|
||||
private $company = 'Microsoft Corporation';
|
||||
|
||||
/**
|
||||
* Custom Properties
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_customProperties = array();
|
||||
private $customProperties = array();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -126,9 +126,9 @@ class PHPExcel_DocumentProperties
|
|||
public function __construct()
|
||||
{
|
||||
// Initialise values
|
||||
$this->_lastModifiedBy = $this->_creator;
|
||||
$this->_created = time();
|
||||
$this->_modified = time();
|
||||
$this->lastModifiedBy = $this->creator;
|
||||
$this->created = time();
|
||||
$this->modified = time();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +138,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getCreator()
|
||||
{
|
||||
return $this->_creator;
|
||||
return $this->creator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,7 +149,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setCreator($pValue = '')
|
||||
{
|
||||
$this->_creator = $pValue;
|
||||
$this->creator = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getLastModifiedBy()
|
||||
{
|
||||
return $this->_lastModifiedBy;
|
||||
return $this->lastModifiedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,7 +171,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setLastModifiedBy($pValue = '')
|
||||
{
|
||||
$this->_lastModifiedBy = $pValue;
|
||||
$this->lastModifiedBy = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getCreated()
|
||||
{
|
||||
return $this->_created;
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -203,7 +203,7 @@ class PHPExcel_DocumentProperties
|
|||
}
|
||||
}
|
||||
|
||||
$this->_created = $pValue;
|
||||
$this->created = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getModified()
|
||||
{
|
||||
return $this->_modified;
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -235,7 +235,7 @@ class PHPExcel_DocumentProperties
|
|||
}
|
||||
}
|
||||
|
||||
$this->_modified = $pValue;
|
||||
$this->modified = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->_title;
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -257,7 +257,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setTitle($pValue = '')
|
||||
{
|
||||
$this->_title = $pValue;
|
||||
$this->title = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -279,7 +279,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setDescription($pValue = '')
|
||||
{
|
||||
$this->_description = $pValue;
|
||||
$this->description = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->_subject;
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -301,7 +301,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setSubject($pValue = '')
|
||||
{
|
||||
$this->_subject = $pValue;
|
||||
$this->subject = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -312,7 +312,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getKeywords()
|
||||
{
|
||||
return $this->_keywords;
|
||||
return $this->keywords;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -323,7 +323,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setKeywords($pValue = '')
|
||||
{
|
||||
$this->_keywords = $pValue;
|
||||
$this->keywords = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -334,7 +334,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
return $this->_category;
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -345,7 +345,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setCategory($pValue = '')
|
||||
{
|
||||
$this->_category = $pValue;
|
||||
$this->category = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getCompany()
|
||||
{
|
||||
return $this->_company;
|
||||
return $this->company;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -367,7 +367,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setCompany($pValue = '')
|
||||
{
|
||||
$this->_company = $pValue;
|
||||
$this->company = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getManager()
|
||||
{
|
||||
return $this->_manager;
|
||||
return $this->manager;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -389,7 +389,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function setManager($pValue = '')
|
||||
{
|
||||
$this->_manager = $pValue;
|
||||
$this->manager = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -400,7 +400,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getCustomProperties()
|
||||
{
|
||||
return array_keys($this->_customProperties);
|
||||
return array_keys($this->customProperties);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -411,7 +411,7 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
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)
|
||||
{
|
||||
if (isset($this->_customProperties[$propertyName])) {
|
||||
return $this->_customProperties[$propertyName]['value'];
|
||||
if (isset($this->customProperties[$propertyName])) {
|
||||
return $this->customProperties[$propertyName]['value'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -436,8 +436,8 @@ class PHPExcel_DocumentProperties
|
|||
*/
|
||||
public function getCustomPropertyType($propertyName)
|
||||
{
|
||||
if (isset($this->_customProperties[$propertyName])) {
|
||||
return $this->_customProperties[$propertyName]['type'];
|
||||
if (isset($this->customProperties[$propertyName])) {
|
||||
return $this->customProperties[$propertyName]['type'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -475,7 +475,7 @@ class PHPExcel_DocumentProperties
|
|||
}
|
||||
}
|
||||
|
||||
$this->_customProperties[$propertyName] = array(
|
||||
$this->customProperties[$propertyName] = array(
|
||||
'value' => $propertyValue,
|
||||
'type' => $propertyType
|
||||
);
|
||||
|
|
|
@ -32,14 +32,14 @@ class PHPExcel_HashTable
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public $_items = array();
|
||||
protected $items = array();
|
||||
|
||||
/**
|
||||
* HashTable key map
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $_keyMap = array();
|
||||
protected $keyMap = array();
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_HashTable
|
||||
|
@ -84,9 +84,9 @@ class PHPExcel_HashTable
|
|||
public function add(PHPExcel_IComparable $pSource = null)
|
||||
{
|
||||
$hash = $pSource->getHashCode();
|
||||
if (!isset($this->_items[$hash])) {
|
||||
$this->_items[$hash] = $pSource;
|
||||
$this->_keyMap[count($this->_items) - 1] = $hash;
|
||||
if (!isset($this->items[$hash])) {
|
||||
$this->items[$hash] = $pSource;
|
||||
$this->keyMap[count($this->items) - 1] = $hash;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,20 +99,20 @@ class PHPExcel_HashTable
|
|||
public function remove(PHPExcel_IComparable $pSource = null)
|
||||
{
|
||||
$hash = $pSource->getHashCode();
|
||||
if (isset($this->_items[$hash])) {
|
||||
unset($this->_items[$hash]);
|
||||
if (isset($this->items[$hash])) {
|
||||
unset($this->items[$hash]);
|
||||
|
||||
$deleteKey = -1;
|
||||
foreach ($this->_keyMap as $key => $value) {
|
||||
foreach ($this->keyMap as $key => $value) {
|
||||
if ($deleteKey >= 0) {
|
||||
$this->_keyMap[$key - 1] = $value;
|
||||
$this->keyMap[$key - 1] = $value;
|
||||
}
|
||||
|
||||
if ($value == $hash) {
|
||||
$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()
|
||||
{
|
||||
$this->_items = array();
|
||||
$this->_keyMap = array();
|
||||
$this->items = array();
|
||||
$this->keyMap = array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,7 +133,7 @@ class PHPExcel_HashTable
|
|||
*/
|
||||
public function count()
|
||||
{
|
||||
return count($this->_items);
|
||||
return count($this->items);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -144,7 +144,7 @@ class PHPExcel_HashTable
|
|||
*/
|
||||
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)
|
||||
{
|
||||
if (isset($this->_keyMap[$pIndex])) {
|
||||
return $this->getByHashCode($this->_keyMap[$pIndex]);
|
||||
if (isset($this->keyMap[$pIndex])) {
|
||||
return $this->getByHashCode($this->keyMap[$pIndex]);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -172,8 +172,8 @@ class PHPExcel_HashTable
|
|||
*/
|
||||
public function getByHashCode($pHashCode = '')
|
||||
{
|
||||
if (isset($this->_items[$pHashCode])) {
|
||||
return $this->_items[$pHashCode];
|
||||
if (isset($this->items[$pHashCode])) {
|
||||
return $this->items[$pHashCode];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -186,7 +186,7 @@ class PHPExcel_HashTable
|
|||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return $this->_items;
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,7 +43,7 @@ class PHPExcel_IOFactory
|
|||
* @access private
|
||||
* @static
|
||||
*/
|
||||
private static $_searchLocations = array(
|
||||
private static $searchLocations = array(
|
||||
array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ),
|
||||
array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' )
|
||||
);
|
||||
|
@ -55,7 +55,7 @@ class PHPExcel_IOFactory
|
|||
* @access private
|
||||
* @static
|
||||
*/
|
||||
private static $_autoResolveClasses = array(
|
||||
private static $autoResolveClasses = array(
|
||||
'Excel2007',
|
||||
'Excel5',
|
||||
'Excel2003XML',
|
||||
|
@ -82,7 +82,7 @@ class PHPExcel_IOFactory
|
|||
*/
|
||||
public static function getSearchLocations()
|
||||
{
|
||||
return self::$_searchLocations;
|
||||
return self::$searchLocations;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ class PHPExcel_IOFactory
|
|||
public static function setSearchLocations($value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
self::$_searchLocations = $value;
|
||||
self::$searchLocations = $value;
|
||||
} else {
|
||||
throw new PHPExcel_Reader_Exception('Invalid parameter passed.');
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ class PHPExcel_IOFactory
|
|||
*/
|
||||
public static function addSearchLocation($type = '', $location = '', $classname = '')
|
||||
{
|
||||
self::$_searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname );
|
||||
self::$searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,7 +132,7 @@ class PHPExcel_IOFactory
|
|||
$searchType = 'IWriter';
|
||||
|
||||
// Include class
|
||||
foreach (self::$_searchLocations as $searchLocation) {
|
||||
foreach (self::$searchLocations as $searchLocation) {
|
||||
if ($searchLocation['type'] == $searchType) {
|
||||
$className = str_replace('{0}', $writerType, $searchLocation['class']);
|
||||
|
||||
|
@ -162,7 +162,7 @@ class PHPExcel_IOFactory
|
|||
$searchType = 'IReader';
|
||||
|
||||
// Include class
|
||||
foreach (self::$_searchLocations as $searchLocation) {
|
||||
foreach (self::$searchLocations as $searchLocation) {
|
||||
if ($searchLocation['type'] == $searchType) {
|
||||
$className = str_replace('{0}', $readerType, $searchLocation['class']);
|
||||
|
||||
|
@ -273,8 +273,8 @@ class PHPExcel_IOFactory
|
|||
}
|
||||
|
||||
// If we reach here then "lucky guess" didn't give any result
|
||||
// Try walking through all the options in self::$_autoResolveClasses
|
||||
foreach (self::$_autoResolveClasses as $autoResolveClass) {
|
||||
// Try walking through all the options in self::$autoResolveClasses
|
||||
foreach (self::$autoResolveClasses as $autoResolveClass) {
|
||||
// Ignore our original guess, we know that won't work
|
||||
if ($autoResolveClass !== $extensionType) {
|
||||
$reader = self::createReader($autoResolveClass);
|
||||
|
|
|
@ -32,35 +32,35 @@ class PHPExcel_NamedRange
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_name;
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* Worksheet on which the named range can be resolved
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
*/
|
||||
private $_worksheet;
|
||||
private $worksheet;
|
||||
|
||||
/**
|
||||
* Range of the referenced cells
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_range;
|
||||
private $range;
|
||||
|
||||
/**
|
||||
* Is the named range local? (i.e. can only be used on $this->_worksheet)
|
||||
* Is the named range local? (i.e. can only be used on $this->worksheet)
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $_localOnly;
|
||||
private $localOnly;
|
||||
|
||||
/**
|
||||
* Scope
|
||||
*
|
||||
* @var PHPExcel_Worksheet
|
||||
*/
|
||||
private $_scope;
|
||||
private $scope;
|
||||
|
||||
/**
|
||||
* Create a new NamedRange
|
||||
|
@ -80,12 +80,11 @@ class PHPExcel_NamedRange
|
|||
}
|
||||
|
||||
// Set local members
|
||||
$this->_name = $pName;
|
||||
$this->_worksheet = $pWorksheet;
|
||||
$this->_range = $pRange;
|
||||
$this->_localOnly = $pLocalOnly;
|
||||
$this->_scope = ($pLocalOnly == true) ?
|
||||
(($pScope == null) ? $pWorksheet : $pScope) : null;
|
||||
$this->name = $pName;
|
||||
$this->worksheet = $pWorksheet;
|
||||
$this->range = $pRange;
|
||||
$this->localOnly = $pLocalOnly;
|
||||
$this->scope = ($pLocalOnly == true) ? (($pScope == null) ? $pWorksheet : $pScope) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,7 +94,7 @@ class PHPExcel_NamedRange
|
|||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -108,21 +107,21 @@ class PHPExcel_NamedRange
|
|||
{
|
||||
if ($value !== null) {
|
||||
// Old title
|
||||
$oldTitle = $this->_name;
|
||||
$oldTitle = $this->name;
|
||||
|
||||
// Re-attach
|
||||
if ($this->_worksheet !== null) {
|
||||
$this->_worksheet->getParent()->removeNamedRange($this->_name, $this->_worksheet);
|
||||
if ($this->worksheet !== null) {
|
||||
$this->worksheet->getParent()->removeNamedRange($this->name, $this->worksheet);
|
||||
}
|
||||
$this->_name = $value;
|
||||
$this->name = $value;
|
||||
|
||||
if ($this->_worksheet !== null) {
|
||||
$this->_worksheet->getParent()->addNamedRange($this);
|
||||
if ($this->worksheet !== null) {
|
||||
$this->worksheet->getParent()->addNamedRange($this);
|
||||
}
|
||||
|
||||
// New title
|
||||
$newTitle = $this->_name;
|
||||
PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle);
|
||||
$newTitle = $this->name;
|
||||
PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->worksheet->getParent(), $oldTitle, $newTitle);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -134,7 +133,7 @@ class PHPExcel_NamedRange
|
|||
*/
|
||||
public function getWorksheet()
|
||||
{
|
||||
return $this->_worksheet;
|
||||
return $this->worksheet;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,7 +145,7 @@ class PHPExcel_NamedRange
|
|||
public function setWorksheet(PHPExcel_Worksheet $value = null)
|
||||
{
|
||||
if ($value !== null) {
|
||||
$this->_worksheet = $value;
|
||||
$this->worksheet = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -158,7 +157,7 @@ class PHPExcel_NamedRange
|
|||
*/
|
||||
public function getRange()
|
||||
{
|
||||
return $this->_range;
|
||||
return $this->range;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,7 +169,7 @@ class PHPExcel_NamedRange
|
|||
public function setRange($value = null)
|
||||
{
|
||||
if ($value !== null) {
|
||||
$this->_range = $value;
|
||||
$this->range = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
@ -182,7 +181,7 @@ class PHPExcel_NamedRange
|
|||
*/
|
||||
public function getLocalOnly()
|
||||
{
|
||||
return $this->_localOnly;
|
||||
return $this->localOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -193,8 +192,8 @@ class PHPExcel_NamedRange
|
|||
*/
|
||||
public function setLocalOnly($value = false)
|
||||
{
|
||||
$this->_localOnly = $value;
|
||||
$this->_scope = $value ? $this->_worksheet : null;
|
||||
$this->localOnly = $value;
|
||||
$this->scope = $value ? $this->worksheet : null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -205,7 +204,7 @@ class PHPExcel_NamedRange
|
|||
*/
|
||||
public function getScope()
|
||||
{
|
||||
return $this->_scope;
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -216,8 +215,8 @@ class PHPExcel_NamedRange
|
|||
*/
|
||||
public function setScope(PHPExcel_Worksheet $value = null)
|
||||
{
|
||||
$this->_scope = $value;
|
||||
$this->_localOnly = ($value == null) ? false : true;
|
||||
$this->scope = $value;
|
||||
$this->localOnly = ($value == null) ? false : true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_inputEncoding = 'UTF-8';
|
||||
private $inputEncoding = 'UTF-8';
|
||||
|
||||
/**
|
||||
* Delimiter
|
||||
|
@ -58,7 +58,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_delimiter = ',';
|
||||
private $delimiter = ',';
|
||||
|
||||
/**
|
||||
* Enclosure
|
||||
|
@ -66,7 +66,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @access private
|
||||
* @var string
|
||||
*/
|
||||
private $_enclosure = '"';
|
||||
private $enclosure = '"';
|
||||
|
||||
/**
|
||||
* Sheet index to read
|
||||
|
@ -74,7 +74,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @access private
|
||||
* @var int
|
||||
*/
|
||||
private $_sheetIndex = 0;
|
||||
private $sheetIndex = 0;
|
||||
|
||||
/**
|
||||
* Load rows contiguously
|
||||
|
@ -82,20 +82,21 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @access private
|
||||
* @var int
|
||||
*/
|
||||
private $_contiguous = false;
|
||||
private $contiguous = false;
|
||||
|
||||
/**
|
||||
* Row counter for loading rows contiguously
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_contiguousRow = -1;
|
||||
private $contiguousRow = -1;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Reader_CSV
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
|
@ -106,7 +107,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*/
|
||||
protected function _isValidFormat()
|
||||
{
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -116,7 +117,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*/
|
||||
public function setInputEncoding($pValue = 'UTF-8')
|
||||
{
|
||||
$this->_inputEncoding = $pValue;
|
||||
$this->inputEncoding = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -127,7 +128,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*/
|
||||
public function getInputEncoding()
|
||||
{
|
||||
return $this->_inputEncoding;
|
||||
return $this->inputEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,7 +139,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
{
|
||||
rewind($this->_fileHandle);
|
||||
|
||||
switch ($this->_inputEncoding) {
|
||||
switch ($this->inputEncoding) {
|
||||
case 'UTF-8':
|
||||
fgets($this->_fileHandle, 4) == "\xEF\xBB\xBF" ?
|
||||
fseek($this->_fileHandle, 3) : fseek($this->_fileHandle, 0);
|
||||
|
@ -183,7 +184,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
// Skip BOM, if any
|
||||
$this->_skipBOM();
|
||||
|
||||
$escapeEnclosures = array( "\\" . $this->_enclosure, $this->_enclosure . $this->_enclosure );
|
||||
$escapeEnclosures = array( "\\" . $this->enclosure, $this->enclosure . $this->enclosure );
|
||||
|
||||
$worksheetInfo = array();
|
||||
$worksheetInfo[0]['worksheetName'] = 'Worksheet';
|
||||
|
@ -193,7 +194,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
$worksheetInfo[0]['totalColumns'] = 0;
|
||||
|
||||
// Loop through each line of the file in turn
|
||||
while (($rowData = fgetcsv($fileHandle, 0, $this->_delimiter, $this->_enclosure)) !== FALSE) {
|
||||
while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure)) !== false) {
|
||||
$worksheetInfo[0]['totalRows']++;
|
||||
$worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1);
|
||||
}
|
||||
|
@ -248,32 +249,32 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
$this->_skipBOM();
|
||||
|
||||
// Create new PHPExcel object
|
||||
while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) {
|
||||
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
|
||||
$objPHPExcel->createSheet();
|
||||
}
|
||||
$sheet = $objPHPExcel->setActiveSheetIndex($this->_sheetIndex);
|
||||
$sheet = $objPHPExcel->setActiveSheetIndex($this->sheetIndex);
|
||||
|
||||
$escapeEnclosures = array( "\\" . $this->_enclosure,
|
||||
$this->_enclosure . $this->_enclosure
|
||||
$escapeEnclosures = array( "\\" . $this->enclosure,
|
||||
$this->enclosure . $this->enclosure
|
||||
);
|
||||
|
||||
// Set our starting row based on whether we're in contiguous mode or not
|
||||
$currentRow = 1;
|
||||
if ($this->_contiguous) {
|
||||
$currentRow = ($this->_contiguousRow == -1) ? $sheet->getHighestRow(): $this->_contiguousRow;
|
||||
if ($this->contiguous) {
|
||||
$currentRow = ($this->contiguousRow == -1) ? $sheet->getHighestRow(): $this->contiguousRow;
|
||||
}
|
||||
|
||||
// Loop through each line of the file in turn
|
||||
while (($rowData = fgetcsv($fileHandle, 0, $this->_delimiter, $this->_enclosure)) !== FALSE) {
|
||||
while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure)) !== false) {
|
||||
$columnLetter = 'A';
|
||||
foreach ($rowData as $rowDatum) {
|
||||
if ($rowDatum != '' && $this->_readFilter->readCell($columnLetter, $currentRow)) {
|
||||
// Unescape enclosures
|
||||
$rowDatum = str_replace($escapeEnclosures, $this->_enclosure, $rowDatum);
|
||||
$rowDatum = str_replace($escapeEnclosures, $this->enclosure, $rowDatum);
|
||||
|
||||
// Convert encoding if necessary
|
||||
if ($this->_inputEncoding !== 'UTF-8') {
|
||||
$rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->_inputEncoding);
|
||||
if ($this->inputEncoding !== 'UTF-8') {
|
||||
$rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->inputEncoding);
|
||||
}
|
||||
|
||||
// Set cell value
|
||||
|
@ -287,8 +288,8 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
// Close file
|
||||
fclose($fileHandle);
|
||||
|
||||
if ($this->_contiguous) {
|
||||
$this->_contiguousRow = $currentRow;
|
||||
if ($this->contiguous) {
|
||||
$this->contiguousRow = $currentRow;
|
||||
}
|
||||
|
||||
ini_set('auto_detect_line_endings', $lineEnding);
|
||||
|
@ -302,8 +303,9 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDelimiter() {
|
||||
return $this->_delimiter;
|
||||
public function getDelimiter()
|
||||
{
|
||||
return $this->delimiter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -312,8 +314,9 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @param string $pValue Delimiter, defaults to ,
|
||||
* @return PHPExcel_Reader_CSV
|
||||
*/
|
||||
public function setDelimiter($pValue = ',') {
|
||||
$this->_delimiter = $pValue;
|
||||
public function setDelimiter($pValue = ',')
|
||||
{
|
||||
$this->delimiter = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -322,8 +325,9 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEnclosure() {
|
||||
return $this->_enclosure;
|
||||
public function getEnclosure()
|
||||
{
|
||||
return $this->enclosure;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -332,11 +336,12 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @param string $pValue Enclosure, defaults to "
|
||||
* @return PHPExcel_Reader_CSV
|
||||
*/
|
||||
public function setEnclosure($pValue = '"') {
|
||||
public function setEnclosure($pValue = '"')
|
||||
{
|
||||
if ($pValue == '') {
|
||||
$pValue = '"';
|
||||
}
|
||||
$this->_enclosure = $pValue;
|
||||
$this->enclosure = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -345,8 +350,9 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getSheetIndex() {
|
||||
return $this->_sheetIndex;
|
||||
public function getSheetIndex()
|
||||
{
|
||||
return $this->sheetIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -355,8 +361,9 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
* @param integer $pValue Sheet index
|
||||
* @return PHPExcel_Reader_CSV
|
||||
*/
|
||||
public function setSheetIndex($pValue = 0) {
|
||||
$this->_sheetIndex = $pValue;
|
||||
public function setSheetIndex($pValue = 0)
|
||||
{
|
||||
$this->sheetIndex = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -365,11 +372,11 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*
|
||||
* @param boolean $contiguous
|
||||
*/
|
||||
public function setContiguous($contiguous = FALSE)
|
||||
public function setContiguous($contiguous = false)
|
||||
{
|
||||
$this->_contiguous = (bool) $contiguous;
|
||||
$this->contiguous = (bool) $contiguous;
|
||||
if (!$contiguous) {
|
||||
$this->_contiguousRow = -1;
|
||||
$this->contiguousRow = -1;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -380,8 +387,8 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getContiguous() {
|
||||
return $this->_contiguous;
|
||||
public function getContiguous()
|
||||
{
|
||||
return $this->contiguous;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -52,7 +52,8 @@ class PHPExcel_Reader_DefaultReadFilter implements PHPExcel_Reader_IReadFilter
|
|||
* @param $worksheetName Optional worksheet name
|
||||
* @return boolean
|
||||
*/
|
||||
public function readCell($column, $row, $worksheetName = '') {
|
||||
public function readCell($column, $row, $worksheetName = '')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
<?php
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* PHPExcel
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel2003XML
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,24 +34,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel2003XML
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
|
@ -49,15 +41,14 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_styles = array();
|
||||
protected $styles = array();
|
||||
|
||||
/**
|
||||
* Character set used in the file
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_charSet = 'UTF-8';
|
||||
|
||||
protected $charSet = 'UTF-8';
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Reader_Excel2003XML
|
||||
|
@ -112,9 +103,9 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
|
||||
// Retrieve charset encoding
|
||||
if (preg_match('/<?xml.*encoding=[\'"](.*?)[\'"].*?>/um', $data, $matches)) {
|
||||
$this->_charSet = strtoupper($matches[1]);
|
||||
$this->charSet = strtoupper($matches[1]);
|
||||
}
|
||||
// echo 'Character Set is ', $this->_charSet,'<br />';
|
||||
// echo 'Character Set is ', $this->charSet,'<br />';
|
||||
|
||||
return $valid;
|
||||
}
|
||||
|
@ -144,7 +135,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
$xml_ss = $xml->children($namespaces['ss']);
|
||||
foreach ($xml_ss->Worksheet as $worksheet) {
|
||||
$worksheet_ss = $worksheet->attributes($namespaces['ss']);
|
||||
$worksheetNames[] = self::_convertStringEncoding((string) $worksheet_ss['Name'], $this->_charSet);
|
||||
$worksheetNames[] = self::_convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
|
||||
}
|
||||
|
||||
return $worksheetNames;
|
||||
|
@ -338,39 +329,39 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) {
|
||||
switch ($propertyName) {
|
||||
case 'Title':
|
||||
$docProps->setTitle(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setTitle(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Subject':
|
||||
$docProps->setSubject(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setSubject(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Author':
|
||||
$docProps->setCreator(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setCreator(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Created':
|
||||
$creationDate = strtotime($propertyValue);
|
||||
$docProps->setCreated($creationDate);
|
||||
break;
|
||||
case 'LastAuthor':
|
||||
$docProps->setLastModifiedBy(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setLastModifiedBy(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'LastSaved':
|
||||
$lastSaveDate = strtotime($propertyValue);
|
||||
$docProps->setModified($lastSaveDate);
|
||||
break;
|
||||
case 'Company':
|
||||
$docProps->setCompany(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setCompany(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Category':
|
||||
$docProps->setCategory(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setCategory(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Manager':
|
||||
$docProps->setManager(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setManager(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Keywords':
|
||||
$docProps->setKeywords(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setKeywords(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
case 'Description':
|
||||
$docProps->setDescription(self::_convertStringEncoding($propertyValue, $this->_charSet));
|
||||
$docProps->setDescription(self::_convertStringEncoding($propertyValue, $this->charSet));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -411,9 +402,9 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
$styleID = (string) $style_ss['ID'];
|
||||
// echo 'Style ID = '.$styleID.'<br />';
|
||||
if ($styleID == 'Default') {
|
||||
$this->_styles['Default'] = array();
|
||||
$this->styles['Default'] = array();
|
||||
} else {
|
||||
$this->_styles[$styleID] = $this->_styles['Default'];
|
||||
$this->styles[$styleID] = $this->styles['Default'];
|
||||
}
|
||||
foreach ($style as $styleType => $styleData) {
|
||||
$styleAttributes = $styleData->attributes($namespaces['ss']);
|
||||
|
@ -426,16 +417,16 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
switch ($styleAttributeKey) {
|
||||
case 'Vertical':
|
||||
if (self::identifyFixedStyleValue($verticalAlignmentStyles, $styleAttributeValue)) {
|
||||
$this->_styles[$styleID]['alignment']['vertical'] = $styleAttributeValue;
|
||||
$this->styles[$styleID]['alignment']['vertical'] = $styleAttributeValue;
|
||||
}
|
||||
break;
|
||||
case 'Horizontal':
|
||||
if (self::identifyFixedStyleValue($horizontalAlignmentStyles, $styleAttributeValue)) {
|
||||
$this->_styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue;
|
||||
$this->styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue;
|
||||
}
|
||||
break;
|
||||
case 'WrapText':
|
||||
$this->_styles[$styleID]['alignment']['wrap'] = true;
|
||||
$this->styles[$styleID]['alignment']['wrap'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -465,7 +456,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
}
|
||||
if (!empty($thisBorder)) {
|
||||
if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) {
|
||||
$this->_styles[$styleID]['borders'][$borderPosition] = $thisBorder;
|
||||
$this->styles[$styleID]['borders'][$borderPosition] = $thisBorder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -476,23 +467,23 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
$styleAttributeValue = (string) $styleAttributeValue;
|
||||
switch ($styleAttributeKey) {
|
||||
case 'FontName':
|
||||
$this->_styles[$styleID]['font']['name'] = $styleAttributeValue;
|
||||
$this->styles[$styleID]['font']['name'] = $styleAttributeValue;
|
||||
break;
|
||||
case 'Size':
|
||||
$this->_styles[$styleID]['font']['size'] = $styleAttributeValue;
|
||||
$this->styles[$styleID]['font']['size'] = $styleAttributeValue;
|
||||
break;
|
||||
case 'Color':
|
||||
$this->_styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue,1);
|
||||
$this->styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue, 1);
|
||||
break;
|
||||
case 'Bold':
|
||||
$this->_styles[$styleID]['font']['bold'] = true;
|
||||
$this->styles[$styleID]['font']['bold'] = true;
|
||||
break;
|
||||
case 'Italic':
|
||||
$this->_styles[$styleID]['font']['italic'] = true;
|
||||
$this->styles[$styleID]['font']['italic'] = true;
|
||||
break;
|
||||
case 'Underline':
|
||||
if (self::identifyFixedStyleValue($underlineStyles, $styleAttributeValue)) {
|
||||
$this->_styles[$styleID]['font']['underline'] = $styleAttributeValue;
|
||||
$this->styles[$styleID]['font']['underline'] = $styleAttributeValue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -503,7 +494,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
// echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
|
||||
switch ($styleAttributeKey) {
|
||||
case 'Color':
|
||||
$this->_styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue,1);
|
||||
$this->styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -518,7 +509,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
break;
|
||||
}
|
||||
if ($styleAttributeValue > '') {
|
||||
$this->_styles[$styleID]['numberformat']['code'] = $styleAttributeValue;
|
||||
$this->styles[$styleID]['numberformat']['code'] = $styleAttributeValue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -529,7 +520,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
break;
|
||||
}
|
||||
}
|
||||
// print_r($this->_styles[$styleID]);
|
||||
// print_r($this->styles[$styleID]);
|
||||
// echo '<hr />';
|
||||
}
|
||||
// echo '<hr />';
|
||||
|
@ -551,7 +542,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
$objPHPExcel->createSheet();
|
||||
$objPHPExcel->setActiveSheetIndex($worksheetID);
|
||||
if (isset($worksheet_ss['Name'])) {
|
||||
$worksheetName = self::_convertStringEncoding((string) $worksheet_ss['Name'], $this->_charSet);
|
||||
$worksheetName = self::_convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
|
||||
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
|
||||
// formula cells... during the load, all formulae should be correct, and we're simply bringing
|
||||
// the worksheet name in line with the formula, not the reverse
|
||||
|
@ -641,7 +632,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
const TYPE_ERROR = 'e';
|
||||
*/
|
||||
case 'String':
|
||||
$cellValue = self::_convertStringEncoding($cellValue, $this->_charSet);
|
||||
$cellValue = self::_convertStringEncoding($cellValue, $this->charSet);
|
||||
$type = PHPExcel_Cell_DataType::TYPE_STRING;
|
||||
break;
|
||||
case 'Number':
|
||||
|
@ -749,20 +740,20 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
// echo $annotation,'<br />';
|
||||
$annotation = strip_tags($node);
|
||||
// echo 'Annotation: ', $annotation,'<br />';
|
||||
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::_convertStringEncoding($author , $this->_charSet))->setText($this->_parseRichText($annotation) );
|
||||
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::_convertStringEncoding($author, $this->charSet))->setText($this->_parseRichText($annotation));
|
||||
}
|
||||
|
||||
if (($cellIsSet) && (isset($cell_ss['StyleID']))) {
|
||||
$style = (string) $cell_ss['StyleID'];
|
||||
// echo 'Cell style for '.$columnID.$rowID.' is '.$style.'<br />';
|
||||
if ((isset($this->_styles[$style])) && (!empty($this->_styles[$style]))) {
|
||||
if ((isset($this->styles[$style])) && (!empty($this->styles[$style]))) {
|
||||
// echo 'Cell '.$columnID.$rowID.'<br />';
|
||||
// print_r($this->_styles[$style]);
|
||||
// print_r($this->styles[$style]);
|
||||
// echo '<br />';
|
||||
if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) {
|
||||
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null);
|
||||
}
|
||||
$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->_styles[$style]);
|
||||
$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
|
||||
}
|
||||
}
|
||||
++$columnID;
|
||||
|
@ -807,7 +798,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
|
|||
{
|
||||
$value = new PHPExcel_RichText();
|
||||
|
||||
$value->createText(self::_convertStringEncoding($is, $this->_charSet));
|
||||
$value->createText(self::_convertStringEncoding($is, $this->charSet));
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
<?php
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* PHPExcel
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel2007
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,24 +34,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel2007
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
|
@ -49,25 +41,24 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
*
|
||||
* @var PHPExcel_ReferenceHelper
|
||||
*/
|
||||
private $_referenceHelper = NULL;
|
||||
private $referenceHelper = null;
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel2007_Theme instance
|
||||
*
|
||||
* @var PHPExcel_Reader_Excel2007_Theme
|
||||
*/
|
||||
private static $_theme = NULL;
|
||||
|
||||
private static $theme = null;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Reader_Excel2007 instance
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance();
|
||||
$this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Can the current PHPExcel_Reader_IReader read the file?
|
||||
*
|
||||
|
@ -85,7 +76,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$zipClass = PHPExcel_Settings::getZipClass();
|
||||
|
||||
// Check if zip class exists
|
||||
// if (!class_exists($zipClass, FALSE)) {
|
||||
// if (!class_exists($zipClass, false)) {
|
||||
// throw new PHPExcel_Reader_Exception($zipClass . " library is not enabled");
|
||||
// }
|
||||
|
||||
|
@ -240,34 +231,34 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
return $worksheetInfo;
|
||||
}
|
||||
|
||||
|
||||
private static function _castToBool($c) {
|
||||
private static function castToBoolean($c)
|
||||
{
|
||||
// echo 'Initial Cast to Boolean', PHP_EOL;
|
||||
$value = isset($c->v) ? (string) $c->v : NULL;
|
||||
$value = isset($c->v) ? (string) $c->v : null;
|
||||
if ($value == '0') {
|
||||
return FALSE;
|
||||
return false;
|
||||
} elseif ($value == '1') {
|
||||
return TRUE;
|
||||
return true;
|
||||
} else {
|
||||
return (bool)$c->v;
|
||||
}
|
||||
return $value;
|
||||
} // function _castToBool()
|
||||
}
|
||||
|
||||
|
||||
private static function _castToError($c) {
|
||||
private static function castToError($c)
|
||||
{
|
||||
// echo 'Initial Cast to Error', PHP_EOL;
|
||||
return isset($c->v) ? (string) $c->v : NULL;
|
||||
} // function _castToError()
|
||||
return isset($c->v) ? (string) $c->v : null;
|
||||
}
|
||||
|
||||
|
||||
private static function _castToString($c) {
|
||||
private static function castToString($c)
|
||||
{
|
||||
// echo 'Initial Cast to String, PHP_EOL;
|
||||
return isset($c->v) ? (string) $c->v : NULL;
|
||||
} // function _castToString()
|
||||
return isset($c->v) ? (string) $c->v : null;
|
||||
}
|
||||
|
||||
|
||||
private function _castToFormula($c, $r,&$cellDataType,&$value,&$calculatedValue,&$sharedFormulas, $castBaseType) {
|
||||
private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType)
|
||||
{
|
||||
// echo 'Formula', PHP_EOL;
|
||||
// echo '$c->f is ', $c->f, PHP_EOL;
|
||||
$cellDataType = 'f';
|
||||
|
@ -287,9 +278,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
// echo 'SETTING NEW SHARED FORMULA', PHP_EOL;
|
||||
// echo 'Master is ', $r, PHP_EOL;
|
||||
// echo 'Formula is ', $value, PHP_EOL;
|
||||
$sharedFormulas[$instance] = array( 'master' => $r,
|
||||
'formula' => $value
|
||||
);
|
||||
$sharedFormulas[$instance] = array('master' => $r, 'formula' => $value);
|
||||
// echo 'New Shared Formula Array:', PHP_EOL;
|
||||
// print_r($sharedFormulas);
|
||||
} else {
|
||||
|
@ -303,11 +292,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$difference[0] = PHPExcel_Cell::columnIndexFromString($current[0]) - PHPExcel_Cell::columnIndexFromString($master[0]);
|
||||
$difference[1] = $current[1] - $master[1];
|
||||
|
||||
$value = $this->_referenceHelper->updateFormulaReferences( $sharedFormulas[$instance]['formula'],
|
||||
'A1',
|
||||
$difference[0],
|
||||
$difference[1]
|
||||
);
|
||||
$value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]);
|
||||
// echo 'Adjusted Formula is ', $value, PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
@ -317,16 +302,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
public function _getFromZipArchive($archive, $fileName = '')
|
||||
{
|
||||
// Root-relative paths
|
||||
if (strpos($fileName, '//') !== false)
|
||||
{
|
||||
if (strpos($fileName, '//') !== false) {
|
||||
$fileName = substr($fileName, strpos($fileName, '//') + 1);
|
||||
}
|
||||
$fileName = PHPExcel_Shared_File::realpath($fileName);
|
||||
|
||||
// Apache POI fixes
|
||||
$contents = $archive->getFromName($fileName);
|
||||
if ($contents === false)
|
||||
{
|
||||
if ($contents === false) {
|
||||
$contents = $archive->getFromName(substr($fileName, 1));
|
||||
}
|
||||
|
||||
|
@ -393,7 +376,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$themeColours[$themePos] = $xmlColourData['val'];
|
||||
}
|
||||
}
|
||||
self::$_theme = new PHPExcel_Reader_Excel2007_Theme($themeName, $colourSchemeName, $themeColours);
|
||||
self::$theme = new PHPExcel_Reader_Excel2007_Theme($themeName, $colourSchemeName, $themeColours);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -420,18 +403,18 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$docProps->setCategory((string) self::array_item($xmlCore->xpath("cp:category")));
|
||||
}
|
||||
break;
|
||||
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties":
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if (is_object($xmlCore)) {
|
||||
$docProps = $excel->getProperties();
|
||||
if (isset($xmlCore->Company))
|
||||
if (isset($xmlCore->Company)) {
|
||||
$docProps->setCompany((string) $xmlCore->Company);
|
||||
if (isset($xmlCore->Manager))
|
||||
}
|
||||
if (isset($xmlCore->Manager)) {
|
||||
$docProps->setManager((string) $xmlCore->Manager);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties":
|
||||
$xmlCore = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
if (is_object($xmlCore)) {
|
||||
|
@ -454,7 +437,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
case "http://schemas.microsoft.com/office/2006/relationships/ui/extensibility":
|
||||
$customUI = $rel['Target'];
|
||||
if (!is_null($customUI)) {
|
||||
$this->_readRibbon($excel, $customUI, $zip);
|
||||
$this->readRibbon($excel, $customUI, $zip);
|
||||
}
|
||||
break;
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
|
||||
|
@ -470,13 +453,13 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (isset($val->t)) {
|
||||
$sharedStrings[] = PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $val->t);
|
||||
} elseif (isset($val->r)) {
|
||||
$sharedStrings[] = $this->_parseRichText($val);
|
||||
$sharedStrings[] = $this->parseRichText($val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$worksheets = array();
|
||||
$macros = $customUI = NULL;
|
||||
$macros = $customUI = null;
|
||||
foreach ($relsWorkbook->Relationship as $ele) {
|
||||
switch ($ele['Type']) {
|
||||
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet":
|
||||
|
@ -496,10 +479,11 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$excel->setHasMacros(true);
|
||||
//short-circuit : not reading vbaProject.bin.rel to get Signature =>allways vbaProjectSignature.bin in 'xl' dir
|
||||
$Certificate = $this->_getFromZipArchive($zip, 'xl/vbaProjectSignature.bin');
|
||||
if ($Certificate !== false)
|
||||
if ($Certificate !== false) {
|
||||
$excel->setMacrosCertificate($Certificate);
|
||||
}
|
||||
}
|
||||
}
|
||||
$styles = array();
|
||||
$cellStyles = array();
|
||||
$xpath = self::array_item($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']"));
|
||||
|
@ -508,7 +492,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if ($xmlStyles && $xmlStyles->numFmts[0]) {
|
||||
$numFmts = $xmlStyles->numFmts[0];
|
||||
}
|
||||
if (isset($numFmts) && ($numFmts !== NULL)) {
|
||||
if (isset($numFmts) && ($numFmts !== null)) {
|
||||
$numFmts->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
}
|
||||
if (!$this->_readDataOnly && $xmlStyles) {
|
||||
|
@ -548,7 +532,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
|
||||
// add style to cellXf collection
|
||||
$objStyle = new PHPExcel_Style;
|
||||
self::_readStyle($objStyle, $style);
|
||||
self::readStyle($objStyle, $style);
|
||||
$excel->addCellXf($objStyle);
|
||||
}
|
||||
|
||||
|
@ -576,7 +560,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
|
||||
// add style to cellStyleXf collection
|
||||
$objStyle = new PHPExcel_Style;
|
||||
self::_readStyle($objStyle, $cellStyle);
|
||||
self::readStyle($objStyle, $cellStyle);
|
||||
$excel->addCellStyleXf($objStyle);
|
||||
}
|
||||
}
|
||||
|
@ -586,8 +570,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
// Conditional Styles
|
||||
if ($xmlStyles->dxfs) {
|
||||
foreach ($xmlStyles->dxfs->dxf as $dxf) {
|
||||
$style = new PHPExcel_Style(FALSE, TRUE);
|
||||
self::_readStyle($style, $dxf);
|
||||
$style = new PHPExcel_Style(false, true);
|
||||
self::readStyle($style, $dxf);
|
||||
$dxfs[] = $style;
|
||||
}
|
||||
}
|
||||
|
@ -598,7 +582,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (isset($cellStyles[intval($cellStyle['xfId'])])) {
|
||||
// Set default style
|
||||
$style = new PHPExcel_Style;
|
||||
self::_readStyle($style, $cellStyles[intval($cellStyle['xfId'])]);
|
||||
self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]);
|
||||
|
||||
// normal style, currently not using it for anything
|
||||
}
|
||||
|
@ -624,7 +608,6 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$countSkippedSheets = 0; // keep track of number of skipped sheets
|
||||
$mapSheetId = array(); // mapping of sheet ids from old to new
|
||||
|
||||
|
||||
$charts = $chartDetails = array();
|
||||
|
||||
if ($xmlWorkbook->sheets) {
|
||||
|
@ -662,27 +645,21 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (isset($xmlSheet->sheetViews->sheetView['zoomScale'])) {
|
||||
$docSheet->getSheetView()->setZoomScale(intval($xmlSheet->sheetViews->sheetView['zoomScale']));
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetViews->sheetView['zoomScaleNormal'])) {
|
||||
$docSheet->getSheetView()->setZoomScaleNormal(intval($xmlSheet->sheetViews->sheetView['zoomScaleNormal']));
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetViews->sheetView['view'])) {
|
||||
$docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']);
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) {
|
||||
$docSheet->setShowGridLines(self::boolean((string)$xmlSheet->sheetViews->sheetView['showGridLines']));
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetViews->sheetView['showRowColHeaders'])) {
|
||||
$docSheet->setShowRowColHeaders(self::boolean((string)$xmlSheet->sheetViews->sheetView['showRowColHeaders']));
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetViews->sheetView['rightToLeft'])) {
|
||||
$docSheet->setRightToLeft(self::boolean((string)$xmlSheet->sheetViews->sheetView['rightToLeft']));
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetViews->sheetView->pane)) {
|
||||
if (isset($xmlSheet->sheetViews->sheetView->pane['topLeftCell'])) {
|
||||
$docSheet->freezePane((string)$xmlSheet->sheetViews->sheetView->pane['topLeftCell']);
|
||||
|
@ -710,7 +687,6 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$docSheet->setSelectedCells($sqref);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->tabColor)) {
|
||||
|
@ -724,25 +700,25 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->outlinePr)) {
|
||||
if (isset($xmlSheet->sheetPr->outlinePr['summaryRight']) &&
|
||||
!self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryRight'])) {
|
||||
$docSheet->setShowSummaryRight(FALSE);
|
||||
$docSheet->setShowSummaryRight(false);
|
||||
} else {
|
||||
$docSheet->setShowSummaryRight(TRUE);
|
||||
$docSheet->setShowSummaryRight(true);
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetPr->outlinePr['summaryBelow']) &&
|
||||
!self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryBelow'])) {
|
||||
$docSheet->setShowSummaryBelow(FALSE);
|
||||
$docSheet->setShowSummaryBelow(false);
|
||||
} else {
|
||||
$docSheet->setShowSummaryBelow(TRUE);
|
||||
$docSheet->setShowSummaryBelow(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->pageSetUpPr)) {
|
||||
if (isset($xmlSheet->sheetPr->pageSetUpPr['fitToPage']) &&
|
||||
!self::boolean((string) $xmlSheet->sheetPr->pageSetUpPr['fitToPage'])) {
|
||||
$docSheet->getPageSetup()->setFitToPage(FALSE);
|
||||
$docSheet->getPageSetup()->setFitToPage(false);
|
||||
} else {
|
||||
$docSheet->getPageSetup()->setFitToPage(TRUE);
|
||||
$docSheet->getPageSetup()->setFitToPage(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -768,14 +744,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"]));
|
||||
}
|
||||
if (self::boolean($col["bestFit"])) {
|
||||
//$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(TRUE);
|
||||
//$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(true);
|
||||
}
|
||||
if (self::boolean($col["hidden"])) {
|
||||
// echo PHPExcel_Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL;
|
||||
$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setVisible(FALSE);
|
||||
$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setVisible(false);
|
||||
}
|
||||
if (self::boolean($col["collapsed"])) {
|
||||
$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setCollapsed(TRUE);
|
||||
$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setCollapsed(true);
|
||||
}
|
||||
if ($col["outlineLevel"] > 0) {
|
||||
$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"]));
|
||||
|
@ -791,18 +767,16 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
|
||||
if (isset($xmlSheet->printOptions) && !$this->_readDataOnly) {
|
||||
if (self::boolean((string) $xmlSheet->printOptions['gridLinesSet'])) {
|
||||
$docSheet->setShowGridlines(TRUE);
|
||||
$docSheet->setShowGridlines(true);
|
||||
}
|
||||
|
||||
if (self::boolean((string) $xmlSheet->printOptions['gridLines'])) {
|
||||
$docSheet->setPrintGridlines(TRUE);
|
||||
$docSheet->setPrintGridlines(true);
|
||||
}
|
||||
|
||||
if (self::boolean((string) $xmlSheet->printOptions['horizontalCentered'])) {
|
||||
$docSheet->getPageSetup()->setHorizontalCentered(TRUE);
|
||||
$docSheet->getPageSetup()->setHorizontalCentered(true);
|
||||
}
|
||||
if (self::boolean((string) $xmlSheet->printOptions['verticalCentered'])) {
|
||||
$docSheet->getPageSetup()->setVerticalCentered(TRUE);
|
||||
$docSheet->getPageSetup()->setVerticalCentered(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -812,10 +786,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$docSheet->getRowDimension(intval($row["r"]))->setRowHeight(floatval($row["ht"]));
|
||||
}
|
||||
if (self::boolean($row["hidden"]) && !$this->_readDataOnly) {
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setVisible(FALSE);
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setVisible(false);
|
||||
}
|
||||
if (self::boolean($row["collapsed"])) {
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setCollapsed(TRUE);
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setCollapsed(true);
|
||||
}
|
||||
if ($row["outlineLevel"] > 0) {
|
||||
$docSheet->getRowDimension(intval($row["r"]))->setOutlineLevel(intval($row["outlineLevel"]));
|
||||
|
@ -831,7 +805,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$calculatedValue = null;
|
||||
|
||||
// Read cell?
|
||||
if ($this->getReadFilter() !== NULL) {
|
||||
if ($this->getReadFilter() !== null) {
|
||||
$coordinates = PHPExcel_Cell::coordinateFromString($r);
|
||||
|
||||
if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) {
|
||||
|
@ -857,15 +831,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
} else {
|
||||
$value = '';
|
||||
}
|
||||
|
||||
break;
|
||||
case "b":
|
||||
// echo 'Boolean', PHP_EOL;
|
||||
if (!isset($c->f)) {
|
||||
$value = self::_castToBool($c);
|
||||
$value = self::castToBoolean($c);
|
||||
} else {
|
||||
// Formula
|
||||
$this->_castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas,'_castToBool');
|
||||
$this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToBoolean');
|
||||
if (isset($c->f['t'])) {
|
||||
$att = array();
|
||||
$att = $c->f;
|
||||
|
@ -876,42 +849,42 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
break;
|
||||
case "inlineStr":
|
||||
// echo 'Inline String', PHP_EOL;
|
||||
$value = $this->_parseRichText($c->is);
|
||||
|
||||
$value = $this->parseRichText($c->is);
|
||||
break;
|
||||
case "e":
|
||||
// echo 'Error', PHP_EOL;
|
||||
if (!isset($c->f)) {
|
||||
$value = self::_castToError($c);
|
||||
$value = self::castToError($c);
|
||||
} else {
|
||||
// Formula
|
||||
$this->_castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas,'_castToError');
|
||||
$this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError');
|
||||
// echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
// echo 'Default', PHP_EOL;
|
||||
if (!isset($c->f)) {
|
||||
// echo 'Not a Formula', PHP_EOL;
|
||||
$value = self::_castToString($c);
|
||||
$value = self::castToString($c);
|
||||
} else {
|
||||
// echo 'Treat as Formula', PHP_EOL;
|
||||
// Formula
|
||||
$this->_castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas,'_castToString');
|
||||
$this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToString');
|
||||
// echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// echo 'Value is ', $value, PHP_EOL;
|
||||
|
||||
// Check for numeric values
|
||||
if (is_numeric($value) && $cellDataType != 's') {
|
||||
if ($value == (int)$value) $value = (int)$value;
|
||||
elseif ($value == (float)$value) $value = (float)$value;
|
||||
elseif ($value == (double)$value) $value = (double)$value;
|
||||
if ($value == (int)$value) {
|
||||
$value = (int)$value;
|
||||
} elseif ($value == (float)$value) {
|
||||
$value = (float)$value;
|
||||
} elseif ($value == (double)$value) {
|
||||
$value = (double)$value;
|
||||
}
|
||||
}
|
||||
|
||||
// Rich text?
|
||||
|
@ -926,7 +899,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
} else {
|
||||
$cell->setValue($value);
|
||||
}
|
||||
if ($calculatedValue !== NULL) {
|
||||
if ($calculatedValue !== null) {
|
||||
$cell->setCalculatedValue($calculatedValue);
|
||||
}
|
||||
|
||||
|
@ -944,14 +917,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) {
|
||||
foreach ($xmlSheet->conditionalFormatting as $conditional) {
|
||||
foreach ($conditional->cfRule as $cfRule) {
|
||||
if (
|
||||
(
|
||||
(string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_NONE ||
|
||||
(string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CELLIS ||
|
||||
(string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT ||
|
||||
(string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_EXPRESSION
|
||||
) && isset($dxfs[intval($cfRule["dxfId"])])
|
||||
) {
|
||||
if (((string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_NONE || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) {
|
||||
$conditionals[(string) $conditional["sqref"]][intval($cfRule["priority"])] = $cfRule;
|
||||
}
|
||||
}
|
||||
|
@ -997,7 +963,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
}
|
||||
|
||||
if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
|
||||
$docSheet->getProtection()->setPassword((string) $xmlSheet->sheetProtection["password"], TRUE);
|
||||
$docSheet->getProtection()->setPassword((string) $xmlSheet->sheetProtection["password"], true);
|
||||
if ($xmlSheet->protectedRanges->protectedRange) {
|
||||
foreach ($xmlSheet->protectedRanges->protectedRange as $protectedRange) {
|
||||
$docSheet->protectCells((string) $protectedRange["sqref"], (string) $protectedRange["password"], true);
|
||||
|
@ -1018,25 +984,20 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER);
|
||||
$filters = $filterColumn->filters;
|
||||
if ((isset($filters["blank"])) && ($filters["blank"] == 1)) {
|
||||
$column->createRule()->setRule(
|
||||
NULL, // Operator is undefined, but always treated as EQUAL
|
||||
''
|
||||
)
|
||||
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
|
||||
// Operator is undefined, but always treated as EQUAL
|
||||
$column->createRule()->setRule(null, '')->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
|
||||
}
|
||||
// Standard filters are always an OR join, so no join rule needs to be set
|
||||
// Entries can be either filter elements
|
||||
foreach ($filters->filter as $filterRule) {
|
||||
$column->createRule()->setRule(
|
||||
NULL, // Operator is undefined, but always treated as EQUAL
|
||||
(string) $filterRule["val"]
|
||||
)
|
||||
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
|
||||
// Operator is undefined, but always treated as EQUAL
|
||||
$column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
|
||||
}
|
||||
// Or Date Group elements
|
||||
foreach ($filters->dateGroupItem as $dateGroupItem) {
|
||||
$column->createRule()->setRule(
|
||||
NULL, // Operator is undefined, but always treated as EQUAL
|
||||
// Operator is undefined, but always treated as EQUAL
|
||||
null,
|
||||
array(
|
||||
'year' => (string) $dateGroupItem["year"],
|
||||
'month' => (string) $dateGroupItem["month"],
|
||||
|
@ -1073,7 +1034,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
// We should only ever have one dynamic filter
|
||||
foreach ($filterColumn->dynamicFilter as $filterRule) {
|
||||
$column->createRule()->setRule(
|
||||
NULL, // Operator is undefined, but always treated as EQUAL
|
||||
// Operator is undefined, but always treated as EQUAL
|
||||
null,
|
||||
(string) $filterRule["val"],
|
||||
(string) $filterRule["type"]
|
||||
)
|
||||
|
@ -1112,7 +1074,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->_readDataOnly) {
|
||||
foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) {
|
||||
$mergeRef = (string) $mergeCell["ref"];
|
||||
if (strpos($mergeRef,':') !== FALSE) {
|
||||
if (strpos($mergeRef, ':') !== false) {
|
||||
$docSheet->mergeCells((string) $mergeCell["ref"]);
|
||||
}
|
||||
}
|
||||
|
@ -1138,13 +1100,13 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$docPageSetup->setPaperSize(intval($xmlSheet->pageSetup["paperSize"]));
|
||||
}
|
||||
if (isset($xmlSheet->pageSetup["scale"])) {
|
||||
$docPageSetup->setScale(intval($xmlSheet->pageSetup["scale"]), FALSE);
|
||||
$docPageSetup->setScale(intval($xmlSheet->pageSetup["scale"]), false);
|
||||
}
|
||||
if (isset($xmlSheet->pageSetup["fitToHeight"]) && intval($xmlSheet->pageSetup["fitToHeight"]) >= 0) {
|
||||
$docPageSetup->setFitToHeight(intval($xmlSheet->pageSetup["fitToHeight"]), FALSE);
|
||||
$docPageSetup->setFitToHeight(intval($xmlSheet->pageSetup["fitToHeight"]), false);
|
||||
}
|
||||
if (isset($xmlSheet->pageSetup["fitToWidth"]) && intval($xmlSheet->pageSetup["fitToWidth"]) >= 0) {
|
||||
$docPageSetup->setFitToWidth(intval($xmlSheet->pageSetup["fitToWidth"]), FALSE);
|
||||
$docPageSetup->setFitToWidth(intval($xmlSheet->pageSetup["fitToWidth"]), false);
|
||||
}
|
||||
if (isset($xmlSheet->pageSetup["firstPageNumber"]) && isset($xmlSheet->pageSetup["useFirstPageNumber"]) &&
|
||||
self::boolean((string) $xmlSheet->pageSetup["useFirstPageNumber"])) {
|
||||
|
@ -1157,27 +1119,27 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
|
||||
if (isset($xmlSheet->headerFooter["differentOddEven"]) &&
|
||||
self::boolean((string)$xmlSheet->headerFooter["differentOddEven"])) {
|
||||
$docHeaderFooter->setDifferentOddEven(TRUE);
|
||||
$docHeaderFooter->setDifferentOddEven(true);
|
||||
} else {
|
||||
$docHeaderFooter->setDifferentOddEven(FALSE);
|
||||
$docHeaderFooter->setDifferentOddEven(false);
|
||||
}
|
||||
if (isset($xmlSheet->headerFooter["differentFirst"]) &&
|
||||
self::boolean((string)$xmlSheet->headerFooter["differentFirst"])) {
|
||||
$docHeaderFooter->setDifferentFirst(TRUE);
|
||||
$docHeaderFooter->setDifferentFirst(true);
|
||||
} else {
|
||||
$docHeaderFooter->setDifferentFirst(FALSE);
|
||||
$docHeaderFooter->setDifferentFirst(false);
|
||||
}
|
||||
if (isset($xmlSheet->headerFooter["scaleWithDoc"]) &&
|
||||
!self::boolean((string)$xmlSheet->headerFooter["scaleWithDoc"])) {
|
||||
$docHeaderFooter->setScaleWithDocument(FALSE);
|
||||
$docHeaderFooter->setScaleWithDocument(false);
|
||||
} else {
|
||||
$docHeaderFooter->setScaleWithDocument(TRUE);
|
||||
$docHeaderFooter->setScaleWithDocument(true);
|
||||
}
|
||||
if (isset($xmlSheet->headerFooter["alignWithMargins"]) &&
|
||||
!self::boolean((string)$xmlSheet->headerFooter["alignWithMargins"])) {
|
||||
$docHeaderFooter->setAlignWithMargins(FALSE);
|
||||
$docHeaderFooter->setAlignWithMargins(false);
|
||||
} else {
|
||||
$docHeaderFooter->setAlignWithMargins(TRUE);
|
||||
$docHeaderFooter->setAlignWithMargins(true);
|
||||
}
|
||||
|
||||
$docHeaderFooter->setOddHeader((string) $xmlSheet->headerFooter->oddHeader);
|
||||
|
@ -1307,9 +1269,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
|
||||
// Loop through contents
|
||||
foreach ($commentsFile->commentList->comment as $comment) {
|
||||
if (!empty($comment['authorId']))
|
||||
if (!empty($comment['authorId'])) {
|
||||
$docSheet->getComment((string)$comment['ref'])->setAuthor($authors[(string)$comment['authorId']]);
|
||||
$docSheet->getComment( (string)$comment['ref'] )->setText( $this->_parseRichText($comment->text) );
|
||||
}
|
||||
$docSheet->getComment((string)$comment['ref'])->setText($this->parseRichText($comment->text));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1336,14 +1299,18 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
|
||||
if (isset($clientData['ObjectType']) && (string)$clientData['ObjectType'] == 'Note') {
|
||||
$temp = $clientData->xpath('.//x:Row');
|
||||
if (is_array($temp)) $row = $temp[0];
|
||||
if (is_array($temp)) {
|
||||
$row = $temp[0];
|
||||
}
|
||||
|
||||
$temp = $clientData->xpath('.//x:Column');
|
||||
if (is_array($temp)) $column = $temp[0];
|
||||
if (is_array($temp)) {
|
||||
$column = $temp[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (($column !== NULL) && ($row !== NULL)) {
|
||||
if (($column !== null) && ($row !== null)) {
|
||||
// Set comment properties
|
||||
$comment = $docSheet->getCommentByColumnAndRow((string) $column, $row + 1);
|
||||
$comment->getFillColor()->setRGB($fillColor);
|
||||
|
@ -1353,12 +1320,21 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
foreach ($styleArray as $stylePair) {
|
||||
$stylePair = explode(':', $stylePair);
|
||||
|
||||
if ($stylePair[0] == 'margin-left') $comment->setMarginLeft($stylePair[1]);
|
||||
if ($stylePair[0] == 'margin-top') $comment->setMarginTop($stylePair[1]);
|
||||
if ($stylePair[0] == 'width') $comment->setWidth($stylePair[1]);
|
||||
if ($stylePair[0] == 'height') $comment->setHeight($stylePair[1]);
|
||||
if ($stylePair[0] == 'visibility') $comment->setVisible( $stylePair[1] == 'visible' );
|
||||
|
||||
if ($stylePair[0] == 'margin-left') {
|
||||
$comment->setMarginLeft($stylePair[1]);
|
||||
}
|
||||
if ($stylePair[0] == 'margin-top') {
|
||||
$comment->setMarginTop($stylePair[1]);
|
||||
}
|
||||
if ($stylePair[0] == 'width') {
|
||||
$comment->setWidth($stylePair[1]);
|
||||
}
|
||||
if ($stylePair[0] == 'height') {
|
||||
$comment->setHeight($stylePair[1]);
|
||||
}
|
||||
if ($stylePair[0] == 'visibility') {
|
||||
$comment->setVisible($stylePair[1] == 'visible');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1446,7 +1422,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]);
|
||||
} elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") {
|
||||
if ($this->_includeCharts) {
|
||||
$charts[self::dir_add($fileDrawing, $ele["Target"])] = array('id' => (string) $ele["Id"],
|
||||
$charts[self::dir_add($fileDrawing, $ele["Target"])] = array(
|
||||
'id' => (string) $ele["Id"],
|
||||
'sheet' => $docSheet->getTitle()
|
||||
);
|
||||
}
|
||||
|
@ -1537,8 +1514,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$chartRef = $graphic->graphicData->children("http://schemas.openxmlformats.org/drawingml/2006/chart")->chart;
|
||||
$thisChart = (string) $chartRef->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
|
||||
$chartDetails[$docSheet->getTitle().'!'.$thisChart] =
|
||||
array( 'fromCoordinate' => $fromCoordinate,
|
||||
$chartDetails[$docSheet->getTitle().'!'.$thisChart] = array(
|
||||
'fromCoordinate' => $fromCoordinate,
|
||||
'fromOffsetX' => $fromOffsetX,
|
||||
'fromOffsetY' => $fromOffsetY,
|
||||
'toCoordinate' => $toCoordinate,
|
||||
|
@ -1549,7 +1526,6 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1567,7 +1543,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
}
|
||||
|
||||
// Valid range?
|
||||
if (stripos((string)$definedName, '#REF!') !== FALSE || $extractedRange == '') {
|
||||
if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1575,7 +1551,6 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if ((string)$definedName['localSheetId'] != '' && (string)$definedName['localSheetId'] == $sheetId) {
|
||||
// Switch on type
|
||||
switch ((string)$definedName['name']) {
|
||||
|
||||
case '_xlnm._FilterDatabase':
|
||||
if ((string)$definedName['hidden'] !== '1') {
|
||||
$extractedRange = explode(',', $extractedRange);
|
||||
|
@ -1587,7 +1562,6 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case '_xlnm.Print_Titles':
|
||||
// Split $extractedRange
|
||||
$extractedRange = explode(',', $extractedRange);
|
||||
|
@ -1600,21 +1574,19 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
// check for repeating columns, e g. 'A:A' or 'A:D'
|
||||
if (preg_match('/!?([A-Z]+)\:([A-Z]+)$/', $range, $matches)) {
|
||||
$docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($matches[1], $matches[2]));
|
||||
}
|
||||
} elseif (preg_match('/!?(\d+)\:(\d+)$/', $range, $matches)) {
|
||||
// check for repeating rows, e.g. '1:1' or '1:5'
|
||||
elseif (preg_match('/!?(\d+)\:(\d+)$/', $range, $matches)) {
|
||||
$docSheet->getPageSetup()->setRowsToRepeatAtTop(array($matches[1], $matches[2]));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case '_xlnm.Print_Area':
|
||||
$rangeSets = explode(',', $extractedRange); // FIXME: what if sheetname contains comma?
|
||||
$newRangeSets = array();
|
||||
foreach ($rangeSets as $rangeSet) {
|
||||
$range = explode('!', $rangeSet); // FIXME: what if sheetname contains exclamation mark?
|
||||
$rangeSet = isset($range[1]) ? $range[1] : $range[0];
|
||||
if (strpos($rangeSet, ':') === FALSE) {
|
||||
if (strpos($rangeSet, ':') === false) {
|
||||
$rangeSet = $rangeSet . ':' . $rangeSet;
|
||||
}
|
||||
$newRangeSets[] = str_replace('$', '', $rangeSet);
|
||||
|
@ -1655,12 +1627,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
// Local defined name
|
||||
// Switch on type
|
||||
switch ((string)$definedName['name']) {
|
||||
|
||||
case '_xlnm._FilterDatabase':
|
||||
case '_xlnm.Print_Titles':
|
||||
case '_xlnm.Print_Area':
|
||||
break;
|
||||
|
||||
default:
|
||||
if ($mapSheetId[(integer) $definedName['localSheetId']] !== null) {
|
||||
$range = explode('!', (string)$definedName);
|
||||
|
@ -1693,7 +1663,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
$extractedRange = isset($range[1]) ? $range[1] : $range[0];
|
||||
}
|
||||
|
||||
if ($locatedSheet !== NULL) {
|
||||
if ($locatedSheet !== null) {
|
||||
$excel->addNamedRange(new PHPExcel_NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false));
|
||||
}
|
||||
}
|
||||
|
@ -1717,10 +1687,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!$this->_readDataOnly) {
|
||||
$contentTypes = simplexml_load_string($this->securityScan($this->_getFromZipArchive($zip, "[Content_Types].xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
foreach ($contentTypes->Override as $contentType) {
|
||||
|
@ -1742,14 +1710,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
|
||||
$excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart);
|
||||
$objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet']));
|
||||
$objChart->setTopLeftPosition( $chartDetails[$chartPositionRef]['fromCoordinate'],
|
||||
$chartDetails[$chartPositionRef]['fromOffsetX'],
|
||||
$chartDetails[$chartPositionRef]['fromOffsetY']
|
||||
);
|
||||
$objChart->setBottomRightPosition( $chartDetails[$chartPositionRef]['toCoordinate'],
|
||||
$chartDetails[$chartPositionRef]['toOffsetX'],
|
||||
$chartDetails[$chartPositionRef]['toOffsetY']
|
||||
);
|
||||
$objChart->setTopLeftPosition($chartDetails[$chartPositionRef]['fromCoordinate'], $chartDetails[$chartPositionRef]['fromOffsetX'], $chartDetails[$chartPositionRef]['fromOffsetY']);
|
||||
$objChart->setBottomRightPosition($chartDetails[$chartPositionRef]['toCoordinate'], $chartDetails[$chartPositionRef]['toOffsetX'], $chartDetails[$chartPositionRef]['toOffsetY']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1762,15 +1724,15 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
return $excel;
|
||||
}
|
||||
|
||||
|
||||
private static function _readColor($color, $background=FALSE) {
|
||||
private static function readColor($color, $background = false)
|
||||
{
|
||||
if (isset($color["rgb"])) {
|
||||
return (string)$color["rgb"];
|
||||
} elseif (isset($color["indexed"])) {
|
||||
return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB();
|
||||
} elseif (isset($color["theme"])) {
|
||||
if (self::$_theme !== NULL) {
|
||||
$returnColour = self::$_theme->getColourByIndex((int)$color["theme"]);
|
||||
if (self::$theme !== null) {
|
||||
$returnColour = self::$theme->getColourByIndex((int)$color["theme"]);
|
||||
if (isset($color["tint"])) {
|
||||
$tintAdjust = (float) $color["tint"];
|
||||
$returnColour = PHPExcel_Style_Color::changeBrightness($returnColour, $tintAdjust);
|
||||
|
@ -1785,8 +1747,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
return 'FF000000';
|
||||
}
|
||||
|
||||
|
||||
private static function _readStyle($docStyle, $style) {
|
||||
private static function readStyle($docStyle, $style)
|
||||
{
|
||||
// format code
|
||||
// if (isset($style->numFmt)) {
|
||||
// if (isset($style->numFmt['formatCode'])) {
|
||||
|
@ -1809,7 +1771,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (isset($style->font->strike)) {
|
||||
$docStyle->getFont()->setStrikethrough(!isset($style->font->strike["val"]) || self::boolean((string) $style->font->strike["val"]));
|
||||
}
|
||||
$docStyle->getFont()->getColor()->setARGB(self::_readColor($style->font->color));
|
||||
$docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color));
|
||||
|
||||
if (isset($style->font->u) && !isset($style->font->u["val"])) {
|
||||
$docStyle->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
|
||||
|
@ -1837,18 +1799,18 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
}
|
||||
$docStyle->getFill()->setRotation(floatval($gradientFill["degree"]));
|
||||
$gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
$docStyle->getFill()->getStartColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=0]"))->color) );
|
||||
$docStyle->getFill()->getEndColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=1]"))->color) );
|
||||
$docStyle->getFill()->getStartColor()->setARGB(self::readColor(self::array_item($gradientFill->xpath("sml:stop[@position=0]"))->color));
|
||||
$docStyle->getFill()->getEndColor()->setARGB(self::readColor(self::array_item($gradientFill->xpath("sml:stop[@position=1]"))->color));
|
||||
} elseif ($style->fill->patternFill) {
|
||||
$patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid';
|
||||
$docStyle->getFill()->setFillType($patternType);
|
||||
if ($style->fill->patternFill->fgColor) {
|
||||
$docStyle->getFill()->getStartColor()->setARGB(self::_readColor($style->fill->patternFill->fgColor,true));
|
||||
$docStyle->getFill()->getStartColor()->setARGB(self::readColor($style->fill->patternFill->fgColor, true));
|
||||
} else {
|
||||
$docStyle->getFill()->getStartColor()->setARGB('FF000000');
|
||||
}
|
||||
if ($style->fill->patternFill->bgColor) {
|
||||
$docStyle->getFill()->getEndColor()->setARGB(self::_readColor($style->fill->patternFill->bgColor,true));
|
||||
$docStyle->getFill()->getEndColor()->setARGB(self::readColor($style->fill->patternFill->bgColor, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1866,11 +1828,11 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
} else {
|
||||
$docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH);
|
||||
}
|
||||
self::_readBorder($docStyle->getBorders()->getLeft(), $style->border->left);
|
||||
self::_readBorder($docStyle->getBorders()->getRight(), $style->border->right);
|
||||
self::_readBorder($docStyle->getBorders()->getTop(), $style->border->top);
|
||||
self::_readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom);
|
||||
self::_readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal);
|
||||
self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left);
|
||||
self::readBorder($docStyle->getBorders()->getRight(), $style->border->right);
|
||||
self::readBorder($docStyle->getBorders()->getTop(), $style->border->top);
|
||||
self::readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom);
|
||||
self::readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal);
|
||||
}
|
||||
|
||||
// alignment
|
||||
|
@ -1917,18 +1879,18 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static function _readBorder($docBorder, $eleBorder) {
|
||||
private static function readBorder($docBorder, $eleBorder)
|
||||
{
|
||||
if (isset($eleBorder["style"])) {
|
||||
$docBorder->setBorderStyle((string) $eleBorder["style"]);
|
||||
}
|
||||
if (isset($eleBorder->color)) {
|
||||
$docBorder->getColor()->setARGB(self::_readColor($eleBorder->color));
|
||||
$docBorder->getColor()->setARGB(self::readColor($eleBorder->color));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _parseRichText($is = null) {
|
||||
private function parseRichText($is = null)
|
||||
{
|
||||
$value = new PHPExcel_RichText();
|
||||
|
||||
if (isset($is->t)) {
|
||||
|
@ -1945,44 +1907,37 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (isset($run->rPr->rFont["val"])) {
|
||||
$objText->getFont()->setName((string) $run->rPr->rFont["val"]);
|
||||
}
|
||||
|
||||
if (isset($run->rPr->sz["val"])) {
|
||||
$objText->getFont()->setSize((string) $run->rPr->sz["val"]);
|
||||
}
|
||||
|
||||
if (isset($run->rPr->color)) {
|
||||
$objText->getFont()->setColor( new PHPExcel_Style_Color( self::_readColor($run->rPr->color) ) );
|
||||
$objText->getFont()->setColor(new PHPExcel_Style_Color(self::readColor($run->rPr->color)));
|
||||
}
|
||||
|
||||
if ((isset($run->rPr->b["val"]) && self::boolean((string) $run->rPr->b["val"])) ||
|
||||
(isset($run->rPr->b) && !isset($run->rPr->b["val"]))) {
|
||||
$objText->getFont()->setBold(TRUE);
|
||||
$objText->getFont()->setBold(true);
|
||||
}
|
||||
|
||||
if ((isset($run->rPr->i["val"]) && self::boolean((string) $run->rPr->i["val"])) ||
|
||||
(isset($run->rPr->i) && !isset($run->rPr->i["val"]))) {
|
||||
$objText->getFont()->setItalic(TRUE);
|
||||
$objText->getFont()->setItalic(true);
|
||||
}
|
||||
|
||||
if (isset($run->rPr->vertAlign) && isset($run->rPr->vertAlign["val"])) {
|
||||
$vertAlign = strtolower((string)$run->rPr->vertAlign["val"]);
|
||||
if ($vertAlign == 'superscript') {
|
||||
$objText->getFont()->setSuperScript(TRUE);
|
||||
$objText->getFont()->setSuperScript(true);
|
||||
}
|
||||
if ($vertAlign == 'subscript') {
|
||||
$objText->getFont()->setSubScript(TRUE);
|
||||
$objText->getFont()->setSubScript(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) {
|
||||
$objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
|
||||
} elseif (isset($run->rPr->u) && isset($run->rPr->u["val"])) {
|
||||
$objText->getFont()->setUnderline((string)$run->rPr->u["val"]);
|
||||
}
|
||||
|
||||
if ((isset($run->rPr->strike["val"]) && self::boolean((string) $run->rPr->strike["val"])) ||
|
||||
(isset($run->rPr->strike) && !isset($run->rPr->strike["val"]))) {
|
||||
$objText->getFont()->setStrikethrough(TRUE);
|
||||
$objText->getFont()->setStrikethrough(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1992,7 +1947,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
return $value;
|
||||
}
|
||||
|
||||
private function _readRibbon($excel, $customUITarget, $zip)
|
||||
private function readRibbon($excel, $customUITarget, $zip)
|
||||
{
|
||||
$baseDir = dirname($customUITarget);
|
||||
$nameCustomUI = basename($customUITarget);
|
||||
|
@ -2022,25 +1977,26 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
if (count($customUIImagesNames) > 0 && count($customUIImagesBinaries) > 0) {
|
||||
$excel->setRibbonBinObjects($customUIImagesNames, $customUIImagesBinaries);
|
||||
} else {
|
||||
$excel->setRibbonBinObjects(NULL);
|
||||
$excel->setRibbonBinObjects(null);
|
||||
}
|
||||
} else {
|
||||
$excel->setRibbonXMLData(NULL);
|
||||
$excel->setRibbonBinObjects(NULL);
|
||||
$excel->setRibbonXMLData(null);
|
||||
$excel->setRibbonBinObjects(null);
|
||||
}
|
||||
}
|
||||
|
||||
private static function array_item($array, $key = 0) {
|
||||
private static function array_item($array, $key = 0)
|
||||
{
|
||||
return (isset($array[$key]) ? $array[$key] : null);
|
||||
}
|
||||
|
||||
|
||||
private static function dir_add($base, $add) {
|
||||
private static function dir_add($base, $add)
|
||||
{
|
||||
return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add");
|
||||
}
|
||||
|
||||
|
||||
private static function toCSSArray($style) {
|
||||
private static function toCSSArray($style)
|
||||
{
|
||||
$style = str_replace(array("\r","\n"), "", $style);
|
||||
|
||||
$temp = explode(';', $style);
|
||||
|
@ -2070,7 +2026,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
|
|||
return $style;
|
||||
}
|
||||
|
||||
private static function boolean($value = NULL)
|
||||
private static function boolean($value = null)
|
||||
{
|
||||
if (is_object($value)) {
|
||||
$value = (string) $value;
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
*/
|
||||
class PHPExcel_Reader_Excel2007_Chart
|
||||
{
|
||||
private static function _getAttribute($component, $name, $format) {
|
||||
private static function getAttribute($component, $name, $format)
|
||||
{
|
||||
$attributes = $component->attributes();
|
||||
if (isset($attributes[$name])) {
|
||||
if ($format == 'string') {
|
||||
|
@ -48,10 +49,11 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
}
|
||||
return null;
|
||||
} // function _getAttribute()
|
||||
}
|
||||
|
||||
|
||||
private static function _readColor($color, $background=false) {
|
||||
private static function readColor($color, $background = false)
|
||||
{
|
||||
if (isset($color["rgb"])) {
|
||||
return (string)$color["rgb"];
|
||||
} elseif (isset($color["indexed"])) {
|
||||
|
@ -59,13 +61,13 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static function readChart($chartElements, $chartName) {
|
||||
public static function readChart($chartElements, $chartName)
|
||||
{
|
||||
$namespacesChartMeta = $chartElements->getNamespaces(true);
|
||||
$chartElementsC = $chartElements->children($namespacesChartMeta['c']);
|
||||
|
||||
$XaxisLabel = $YaxisLabel = $legend = $title = NULL;
|
||||
$dispBlanksAs = $plotVisOnly = NULL;
|
||||
$XaxisLabel = $YaxisLabel = $legend = $title = null;
|
||||
$dispBlanksAs = $plotVisOnly = null;
|
||||
|
||||
foreach ($chartElementsC as $chartElementKey => $chartElement) {
|
||||
switch ($chartElementKey) {
|
||||
|
@ -79,99 +81,99 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
foreach ($chartDetails as $chartDetailKey => $chartDetail) {
|
||||
switch ($chartDetailKey) {
|
||||
case "layout":
|
||||
$plotAreaLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta,'plotArea');
|
||||
$plotAreaLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'plotArea');
|
||||
break;
|
||||
case "catAx":
|
||||
if (isset($chartDetail->title)) {
|
||||
$XaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta,'cat');
|
||||
$XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
|
||||
}
|
||||
break;
|
||||
case "dateAx":
|
||||
if (isset($chartDetail->title)) {
|
||||
$XaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta,'cat');
|
||||
$XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
|
||||
}
|
||||
break;
|
||||
case "valAx":
|
||||
if (isset($chartDetail->title)) {
|
||||
$YaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta,'cat');
|
||||
$YaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
|
||||
}
|
||||
break;
|
||||
case "barChart":
|
||||
case "bar3DChart":
|
||||
$barDirection = self::_getAttribute($chartDetail->barDir, 'val', 'string');
|
||||
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$barDirection = self::getAttribute($chartDetail->barDir, 'val', 'string');
|
||||
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotSer->setPlotDirection($barDirection);
|
||||
$plotSeries[] = $plotSer;
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "lineChart":
|
||||
case "line3DChart":
|
||||
$plotSeries[] = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "areaChart":
|
||||
case "area3DChart":
|
||||
$plotSeries[] = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "doughnutChart":
|
||||
case "pieChart":
|
||||
case "pie3DChart":
|
||||
$explosion = isset($chartDetail->ser->explosion);
|
||||
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotSer->setPlotStyle($explosion);
|
||||
$plotSeries[] = $plotSer;
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "scatterChart":
|
||||
$scatterStyle = self::_getAttribute($chartDetail->scatterStyle, 'val', 'string');
|
||||
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$scatterStyle = self::getAttribute($chartDetail->scatterStyle, 'val', 'string');
|
||||
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotSer->setPlotStyle($scatterStyle);
|
||||
$plotSeries[] = $plotSer;
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "bubbleChart":
|
||||
$bubbleScale = self::_getAttribute($chartDetail->bubbleScale, 'val', 'integer');
|
||||
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$bubbleScale = self::getAttribute($chartDetail->bubbleScale, 'val', 'integer');
|
||||
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotSer->setPlotStyle($bubbleScale);
|
||||
$plotSeries[] = $plotSer;
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "radarChart":
|
||||
$radarStyle = self::_getAttribute($chartDetail->radarStyle, 'val', 'string');
|
||||
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$radarStyle = self::getAttribute($chartDetail->radarStyle, 'val', 'string');
|
||||
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotSer->setPlotStyle($radarStyle);
|
||||
$plotSeries[] = $plotSer;
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "surfaceChart":
|
||||
case "surface3DChart":
|
||||
$wireFrame = self::_getAttribute($chartDetail->wireframe, 'val', 'boolean');
|
||||
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$wireFrame = self::getAttribute($chartDetail->wireframe, 'val', 'boolean');
|
||||
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotSer->setPlotStyle($wireFrame);
|
||||
$plotSeries[] = $plotSer;
|
||||
$plotAttributes = self::_readChartAttributes($chartDetail);
|
||||
$plotAttributes = self::readChartAttributes($chartDetail);
|
||||
break;
|
||||
case "stockChart":
|
||||
$plotSeries[] = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotAttributes = self::_readChartAttributes($plotAreaLayout);
|
||||
$plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
|
||||
$plotAttributes = self::readChartAttributes($plotAreaLayout);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($plotAreaLayout == NULL) {
|
||||
if ($plotAreaLayout == null) {
|
||||
$plotAreaLayout = new PHPExcel_Chart_Layout();
|
||||
}
|
||||
$plotArea = new PHPExcel_Chart_PlotArea($plotAreaLayout, $plotSeries);
|
||||
self::_setChartAttributes($plotAreaLayout, $plotAttributes);
|
||||
self::setChartAttributes($plotAreaLayout, $plotAttributes);
|
||||
break;
|
||||
case "plotVisOnly":
|
||||
$plotVisOnly = self::_getAttribute($chartDetails, 'val', 'string');
|
||||
$plotVisOnly = self::getAttribute($chartDetails, 'val', 'string');
|
||||
break;
|
||||
case "dispBlanksAs":
|
||||
$dispBlanksAs = self::_getAttribute($chartDetails, 'val', 'string');
|
||||
$dispBlanksAs = self::getAttribute($chartDetails, 'val', 'string');
|
||||
break;
|
||||
case "title":
|
||||
$title = self::_chartTitle($chartDetails, $namespacesChartMeta,'title');
|
||||
$title = self::chartTitle($chartDetails, $namespacesChartMeta, 'title');
|
||||
break;
|
||||
case "legend":
|
||||
$legendPos = 'r';
|
||||
|
@ -180,13 +182,13 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
foreach ($chartDetails as $chartDetailKey => $chartDetail) {
|
||||
switch ($chartDetailKey) {
|
||||
case "legendPos":
|
||||
$legendPos = self::_getAttribute($chartDetail, 'val', 'string');
|
||||
$legendPos = self::getAttribute($chartDetail, 'val', 'string');
|
||||
break;
|
||||
case "overlay":
|
||||
$legendOverlay = self::_getAttribute($chartDetail, 'val', 'boolean');
|
||||
$legendOverlay = self::getAttribute($chartDetail, 'val', 'boolean');
|
||||
break;
|
||||
case "layout":
|
||||
$legendLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta,'legend');
|
||||
$legendLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'legend');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -199,10 +201,10 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
$chart = new PHPExcel_Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel);
|
||||
|
||||
return $chart;
|
||||
} // function readChart()
|
||||
}
|
||||
|
||||
|
||||
private static function _chartTitle($titleDetails, $namespacesChartMeta, $type) {
|
||||
private static function chartTitle($titleDetails, $namespacesChartMeta, $type)
|
||||
{
|
||||
$caption = array();
|
||||
$titleLayout = null;
|
||||
foreach ($titleDetails as $titleDetailKey => $chartDetail) {
|
||||
|
@ -213,21 +215,21 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
switch ($titleKey) {
|
||||
case "p":
|
||||
$titleDetailPart = $titleDetail->children($namespacesChartMeta['a']);
|
||||
$caption[] = self::_parseRichText($titleDetailPart);
|
||||
$caption[] = self::parseRichText($titleDetailPart);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "layout":
|
||||
$titleLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta);
|
||||
$titleLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new PHPExcel_Chart_Title($caption, $titleLayout);
|
||||
} // function _chartTitle()
|
||||
}
|
||||
|
||||
|
||||
private static function _chartLayoutDetails($chartDetail, $namespacesChartMeta) {
|
||||
private static function chartLayoutDetails($chartDetail, $namespacesChartMeta)
|
||||
{
|
||||
if (!isset($chartDetail->manualLayout)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -237,15 +239,15 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
$layout = array();
|
||||
foreach ($details as $detailKey => $detail) {
|
||||
// echo $detailKey,' => ',self::_getAttribute($detail, 'val', 'string'),PHP_EOL;
|
||||
$layout[$detailKey] = self::_getAttribute($detail, 'val', 'string');
|
||||
// echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL;
|
||||
$layout[$detailKey] = self::getAttribute($detail, 'val', 'string');
|
||||
}
|
||||
return new PHPExcel_Chart_Layout($layout);
|
||||
} // function _chartLayoutDetails()
|
||||
}
|
||||
|
||||
|
||||
private static function _chartDataSeries($chartDetail, $namespacesChartMeta, $plotType) {
|
||||
$multiSeriesType = NULL;
|
||||
private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType)
|
||||
{
|
||||
$multiSeriesType = null;
|
||||
$smoothLine = false;
|
||||
$seriesLabel = $seriesCategory = $seriesValues = $plotOrder = array();
|
||||
|
||||
|
@ -253,77 +255,79 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
foreach ($seriesDetailSet as $seriesDetailKey => $seriesDetails) {
|
||||
switch ($seriesDetailKey) {
|
||||
case "grouping":
|
||||
$multiSeriesType = self::_getAttribute($chartDetail->grouping, 'val', 'string');
|
||||
$multiSeriesType = self::getAttribute($chartDetail->grouping, 'val', 'string');
|
||||
break;
|
||||
case "ser":
|
||||
$marker = NULL;
|
||||
$marker = null;
|
||||
foreach ($seriesDetails as $seriesKey => $seriesDetail) {
|
||||
switch ($seriesKey) {
|
||||
case "idx":
|
||||
$seriesIndex = self::_getAttribute($seriesDetail, 'val', 'integer');
|
||||
$seriesIndex = self::getAttribute($seriesDetail, 'val', 'integer');
|
||||
break;
|
||||
case "order":
|
||||
$seriesOrder = self::_getAttribute($seriesDetail, 'val', 'integer');
|
||||
$seriesOrder = self::getAttribute($seriesDetail, 'val', 'integer');
|
||||
$plotOrder[$seriesIndex] = $seriesOrder;
|
||||
break;
|
||||
case "tx":
|
||||
$seriesLabel[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
|
||||
$seriesLabel[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
|
||||
break;
|
||||
case "marker":
|
||||
$marker = self::_getAttribute($seriesDetail->symbol, 'val', 'string');
|
||||
$marker = self::getAttribute($seriesDetail->symbol, 'val', 'string');
|
||||
break;
|
||||
case "smooth":
|
||||
$smoothLine = self::_getAttribute($seriesDetail, 'val', 'boolean');
|
||||
$smoothLine = self::getAttribute($seriesDetail, 'val', 'boolean');
|
||||
break;
|
||||
case "cat":
|
||||
$seriesCategory[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
|
||||
$seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
|
||||
break;
|
||||
case "val":
|
||||
$seriesValues[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
|
||||
$seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
|
||||
break;
|
||||
case "xVal":
|
||||
$seriesCategory[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
|
||||
$seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
|
||||
break;
|
||||
case "yVal":
|
||||
$seriesValues[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
|
||||
$seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new PHPExcel_Chart_DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine);
|
||||
} // function _chartDataSeries()
|
||||
}
|
||||
|
||||
|
||||
private static function _chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker = null, $smoothLine = false) {
|
||||
private static function chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker = null, $smoothLine = false)
|
||||
{
|
||||
if (isset($seriesDetail->strRef)) {
|
||||
$seriesSource = (string) $seriesDetail->strRef->f;
|
||||
$seriesData = self::_chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']),'s');
|
||||
$seriesData = self::chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's');
|
||||
|
||||
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
|
||||
} elseif (isset($seriesDetail->numRef)) {
|
||||
$seriesSource = (string) $seriesDetail->numRef->f;
|
||||
$seriesData = self::_chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c']));
|
||||
$seriesData = self::chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c']));
|
||||
|
||||
return new PHPExcel_Chart_DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
|
||||
} elseif (isset($seriesDetail->multiLvlStrRef)) {
|
||||
$seriesSource = (string) $seriesDetail->multiLvlStrRef->f;
|
||||
$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']),'s');
|
||||
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's');
|
||||
$seriesData['pointCount'] = count($seriesData['dataValues']);
|
||||
|
||||
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
|
||||
} elseif (isset($seriesDetail->multiLvlNumRef)) {
|
||||
$seriesSource = (string) $seriesDetail->multiLvlNumRef->f;
|
||||
$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']),'s');
|
||||
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's');
|
||||
$seriesData['pointCount'] = count($seriesData['dataValues']);
|
||||
|
||||
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
|
||||
}
|
||||
return null;
|
||||
} // function _chartDataSeriesValueSet()
|
||||
}
|
||||
|
||||
|
||||
private static function _chartDataSeriesValues($seriesValueSet, $dataType='n') {
|
||||
private static function chartDataSeriesValues($seriesValueSet, $dataType = 'n')
|
||||
{
|
||||
$seriesVal = array();
|
||||
$formatCode = '';
|
||||
$pointCount = 0;
|
||||
|
@ -331,13 +335,13 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
foreach ($seriesValueSet as $seriesValueIdx => $seriesValue) {
|
||||
switch ($seriesValueIdx) {
|
||||
case 'ptCount':
|
||||
$pointCount = self::_getAttribute($seriesValue, 'val', 'integer');
|
||||
$pointCount = self::getAttribute($seriesValue, 'val', 'integer');
|
||||
break;
|
||||
case 'formatCode':
|
||||
$formatCode = (string) $seriesValue;
|
||||
break;
|
||||
case 'pt':
|
||||
$pointVal = self::_getAttribute($seriesValue, 'idx', 'integer');
|
||||
$pointVal = self::getAttribute($seriesValue, 'idx', 'integer');
|
||||
if ($dataType == 's') {
|
||||
$seriesVal[$pointVal] = (string) $seriesValue->v;
|
||||
} else {
|
||||
|
@ -348,17 +352,18 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
|
||||
if (empty($seriesVal)) {
|
||||
$seriesVal = NULL;
|
||||
$seriesVal = null;
|
||||
}
|
||||
|
||||
return array( 'formatCode' => $formatCode,
|
||||
return array(
|
||||
'formatCode' => $formatCode,
|
||||
'pointCount' => $pointCount,
|
||||
'dataValues' => $seriesVal
|
||||
);
|
||||
} // function _chartDataSeriesValues()
|
||||
}
|
||||
|
||||
|
||||
private static function _chartDataSeriesValuesMultiLevel($seriesValueSet, $dataType='n') {
|
||||
private static function chartDataSeriesValuesMultiLevel($seriesValueSet, $dataType = 'n')
|
||||
{
|
||||
$seriesVal = array();
|
||||
$formatCode = '';
|
||||
$pointCount = 0;
|
||||
|
@ -367,13 +372,13 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
foreach ($seriesLevel as $seriesValueIdx => $seriesValue) {
|
||||
switch ($seriesValueIdx) {
|
||||
case 'ptCount':
|
||||
$pointCount = self::_getAttribute($seriesValue, 'val', 'integer');
|
||||
$pointCount = self::getAttribute($seriesValue, 'val', 'integer');
|
||||
break;
|
||||
case 'formatCode':
|
||||
$formatCode = (string) $seriesValue;
|
||||
break;
|
||||
case 'pt':
|
||||
$pointVal = self::_getAttribute($seriesValue, 'idx', 'integer');
|
||||
$pointVal = self::getAttribute($seriesValue, 'idx', 'integer');
|
||||
if ($dataType == 's') {
|
||||
$seriesVal[$pointVal][] = (string) $seriesValue->v;
|
||||
} else {
|
||||
|
@ -384,13 +389,15 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
}
|
||||
|
||||
return array( 'formatCode' => $formatCode,
|
||||
return array(
|
||||
'formatCode' => $formatCode,
|
||||
'pointCount' => $pointCount,
|
||||
'dataValues' => $seriesVal
|
||||
);
|
||||
} // function _chartDataSeriesValuesMultiLevel()
|
||||
}
|
||||
|
||||
private static function _parseRichText($titleDetailPart = null) {
|
||||
private static function parseRichText($titleDetailPart = null)
|
||||
{
|
||||
$value = new PHPExcel_RichText();
|
||||
|
||||
foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) {
|
||||
|
@ -402,27 +409,27 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
$objText->getFont()->setName((string) $titleDetailElement->rPr->rFont["val"]);
|
||||
}
|
||||
|
||||
$fontSize = (self::_getAttribute($titleDetailElement->rPr, 'sz', 'integer'));
|
||||
$fontSize = (self::getAttribute($titleDetailElement->rPr, 'sz', 'integer'));
|
||||
if (!is_null($fontSize)) {
|
||||
$objText->getFont()->setSize(floor($fontSize / 100));
|
||||
}
|
||||
|
||||
$fontColor = (self::_getAttribute($titleDetailElement->rPr, 'color', 'string'));
|
||||
$fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string'));
|
||||
if (!is_null($fontColor)) {
|
||||
$objText->getFont()->setColor( new PHPExcel_Style_Color( self::_readColor($fontColor) ) );
|
||||
$objText->getFont()->setColor(new PHPExcel_Style_Color(self::readColor($fontColor)));
|
||||
}
|
||||
|
||||
$bold = self::_getAttribute($titleDetailElement->rPr, 'b', 'boolean');
|
||||
$bold = self::getAttribute($titleDetailElement->rPr, 'b', 'boolean');
|
||||
if (!is_null($bold)) {
|
||||
$objText->getFont()->setBold($bold);
|
||||
}
|
||||
|
||||
$italic = self::_getAttribute($titleDetailElement->rPr, 'i', 'boolean');
|
||||
$italic = self::getAttribute($titleDetailElement->rPr, 'i', 'boolean');
|
||||
if (!is_null($italic)) {
|
||||
$objText->getFont()->setItalic($italic);
|
||||
}
|
||||
|
||||
$baseline = self::_getAttribute($titleDetailElement->rPr, 'baseline', 'integer');
|
||||
$baseline = self::getAttribute($titleDetailElement->rPr, 'baseline', 'integer');
|
||||
if (!is_null($baseline)) {
|
||||
if ($baseline > 0) {
|
||||
$objText->getFont()->setSuperScript(true);
|
||||
|
@ -431,7 +438,7 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
}
|
||||
|
||||
$underscore = (self::_getAttribute($titleDetailElement->rPr, 'u', 'string'));
|
||||
$underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string'));
|
||||
if (!is_null($underscore)) {
|
||||
if ($underscore == 'sng') {
|
||||
$objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
|
||||
|
@ -442,7 +449,7 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
}
|
||||
|
||||
$strikethrough = (self::_getAttribute($titleDetailElement->rPr, 's', 'string'));
|
||||
$strikethrough = (self::getAttribute($titleDetailElement->rPr, 's', 'string'));
|
||||
if (!is_null($strikethrough)) {
|
||||
if ($strikethrough == 'noStrike') {
|
||||
$objText->getFont()->setStrikethrough(false);
|
||||
|
@ -456,36 +463,37 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
return $value;
|
||||
}
|
||||
|
||||
private static function _readChartAttributes($chartDetail) {
|
||||
private static function readChartAttributes($chartDetail)
|
||||
{
|
||||
$plotAttributes = array();
|
||||
if (isset($chartDetail->dLbls)) {
|
||||
if (isset($chartDetail->dLbls->howLegendKey)) {
|
||||
$plotAttributes['showLegendKey'] = self::_getAttribute($chartDetail->dLbls->showLegendKey, 'val', 'string');
|
||||
$plotAttributes['showLegendKey'] = self::getAttribute($chartDetail->dLbls->showLegendKey, 'val', 'string');
|
||||
}
|
||||
if (isset($chartDetail->dLbls->showVal)) {
|
||||
$plotAttributes['showVal'] = self::_getAttribute($chartDetail->dLbls->showVal, 'val', 'string');
|
||||
$plotAttributes['showVal'] = self::getAttribute($chartDetail->dLbls->showVal, 'val', 'string');
|
||||
}
|
||||
if (isset($chartDetail->dLbls->showCatName)) {
|
||||
$plotAttributes['showCatName'] = self::_getAttribute($chartDetail->dLbls->showCatName, 'val', 'string');
|
||||
$plotAttributes['showCatName'] = self::getAttribute($chartDetail->dLbls->showCatName, 'val', 'string');
|
||||
}
|
||||
if (isset($chartDetail->dLbls->showSerName)) {
|
||||
$plotAttributes['showSerName'] = self::_getAttribute($chartDetail->dLbls->showSerName, 'val', 'string');
|
||||
$plotAttributes['showSerName'] = self::getAttribute($chartDetail->dLbls->showSerName, 'val', 'string');
|
||||
}
|
||||
if (isset($chartDetail->dLbls->showPercent)) {
|
||||
$plotAttributes['showPercent'] = self::_getAttribute($chartDetail->dLbls->showPercent, 'val', 'string');
|
||||
$plotAttributes['showPercent'] = self::getAttribute($chartDetail->dLbls->showPercent, 'val', 'string');
|
||||
}
|
||||
if (isset($chartDetail->dLbls->showBubbleSize)) {
|
||||
$plotAttributes['showBubbleSize'] = self::_getAttribute($chartDetail->dLbls->showBubbleSize, 'val', 'string');
|
||||
$plotAttributes['showBubbleSize'] = self::getAttribute($chartDetail->dLbls->showBubbleSize, 'val', 'string');
|
||||
}
|
||||
if (isset($chartDetail->dLbls->showLeaderLines)) {
|
||||
$plotAttributes['showLeaderLines'] = self::_getAttribute($chartDetail->dLbls->showLeaderLines, 'val', 'string');
|
||||
$plotAttributes['showLeaderLines'] = self::getAttribute($chartDetail->dLbls->showLeaderLines, 'val', 'string');
|
||||
}
|
||||
}
|
||||
|
||||
return $plotAttributes;
|
||||
}
|
||||
|
||||
private static function _setChartAttributes($plotArea, $plotAttributes)
|
||||
private static function setChartAttributes($plotArea, $plotAttributes)
|
||||
{
|
||||
foreach ($plotAttributes as $plotAttributeKey => $plotAttributeValue) {
|
||||
switch ($plotAttributeKey) {
|
||||
|
@ -513,5 +521,4 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,21 +40,21 @@ class PHPExcel_Reader_Excel2007_Theme
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_themeName;
|
||||
private $themeName;
|
||||
|
||||
/**
|
||||
* Colour Scheme Name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_colourSchemeName;
|
||||
private $colourSchemeName;
|
||||
|
||||
/**
|
||||
* Colour Map indexed by position
|
||||
*
|
||||
* @var array of string
|
||||
*/
|
||||
private $_colourMapValues;
|
||||
private $colourMapValues;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -62,7 +62,7 @@ class PHPExcel_Reader_Excel2007_Theme
|
|||
*
|
||||
* @var array of string
|
||||
*/
|
||||
private $_colourMap;
|
||||
private $colourMap;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -72,9 +72,9 @@ class PHPExcel_Reader_Excel2007_Theme
|
|||
public function __construct($themeName, $colourSchemeName, $colourMap)
|
||||
{
|
||||
// Initialise values
|
||||
$this->_themeName = $themeName;
|
||||
$this->_colourSchemeName = $colourSchemeName;
|
||||
$this->_colourMap = $colourMap;
|
||||
$this->themeName = $themeName;
|
||||
$this->colourSchemeName = $colourSchemeName;
|
||||
$this->colourMap = $colourMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,7 +84,7 @@ class PHPExcel_Reader_Excel2007_Theme
|
|||
*/
|
||||
public function getThemeName()
|
||||
{
|
||||
return $this->_themeName;
|
||||
return $this->themeName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,8 +92,9 @@ class PHPExcel_Reader_Excel2007_Theme
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getColourSchemeName() {
|
||||
return $this->_colourSchemeName;
|
||||
public function getColourSchemeName()
|
||||
{
|
||||
return $this->colourSchemeName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,9 +102,10 @@ class PHPExcel_Reader_Excel2007_Theme
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getColourByIndex($index=0) {
|
||||
if (isset($this->_colourMap[$index])) {
|
||||
return $this->_colourMap[$index];
|
||||
public function getColourByIndex($index = 0)
|
||||
{
|
||||
if (isset($this->colourMap[$index])) {
|
||||
return $this->colourMap[$index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -111,7 +113,8 @@ class PHPExcel_Reader_Excel2007_Theme
|
|||
/**
|
||||
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
||||
*/
|
||||
public function __clone() {
|
||||
public function __clone()
|
||||
{
|
||||
$vars = get_object_vars($this);
|
||||
foreach ($vars as $key => $value) {
|
||||
if ((is_object($value)) && ($key != '_parent')) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_Excel5_Escher
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel5_Escher
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader_Excel5
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_Excel5_Escher
|
||||
{
|
||||
const DGGCONTAINER = 0xF000;
|
||||
|
@ -58,28 +51,28 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_data;
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* Size in bytes of the Escher stream data
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_dataSize;
|
||||
private $dataSize;
|
||||
|
||||
/**
|
||||
* Current position of stream pointer in Escher stream data
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_pos;
|
||||
private $pos;
|
||||
|
||||
/**
|
||||
* The object to be returned by the reader. Modified during load.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $_object;
|
||||
private $object;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Reader_Excel5_Escher instance
|
||||
|
@ -88,7 +81,7 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
*/
|
||||
public function __construct($object)
|
||||
{
|
||||
$this->_object = $object;
|
||||
$this->object = $object;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,80 +91,117 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
*/
|
||||
public function load($data)
|
||||
{
|
||||
$this->_data = $data;
|
||||
$this->data = $data;
|
||||
|
||||
// total byte size of Excel data (workbook global substream + sheet substreams)
|
||||
$this->_dataSize = strlen($this->_data);
|
||||
$this->dataSize = strlen($this->data);
|
||||
|
||||
$this->_pos = 0;
|
||||
$this->pos = 0;
|
||||
|
||||
// Parse Escher stream
|
||||
while ($this->_pos < $this->_dataSize) {
|
||||
|
||||
while ($this->pos < $this->dataSize) {
|
||||
// offset: 2; size: 2: Record Type
|
||||
$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2);
|
||||
$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos + 2);
|
||||
|
||||
switch ($fbt) {
|
||||
case self::DGGCONTAINER: $this->_readDggContainer(); break;
|
||||
case self::DGG: $this->_readDgg(); break;
|
||||
case self::BSTORECONTAINER: $this->_readBstoreContainer(); break;
|
||||
case self::BSE: $this->_readBSE(); break;
|
||||
case self::BLIPJPEG: $this->_readBlipJPEG(); break;
|
||||
case self::BLIPPNG: $this->_readBlipPNG(); break;
|
||||
case self::OPT: $this->_readOPT(); break;
|
||||
case self::TERTIARYOPT: $this->_readTertiaryOPT(); break;
|
||||
case self::SPLITMENUCOLORS: $this->_readSplitMenuColors(); break;
|
||||
case self::DGCONTAINER: $this->_readDgContainer(); break;
|
||||
case self::DG: $this->_readDg(); break;
|
||||
case self::SPGRCONTAINER: $this->_readSpgrContainer(); break;
|
||||
case self::SPCONTAINER: $this->_readSpContainer(); break;
|
||||
case self::SPGR: $this->_readSpgr(); break;
|
||||
case self::SP: $this->_readSp(); break;
|
||||
case self::CLIENTTEXTBOX: $this->_readClientTextbox(); break;
|
||||
case self::CLIENTANCHOR: $this->_readClientAnchor(); break;
|
||||
case self::CLIENTDATA: $this->_readClientData(); break;
|
||||
default: $this->_readDefault(); break;
|
||||
case self::DGGCONTAINER:
|
||||
$this->readDggContainer();
|
||||
break;
|
||||
case self::DGG:
|
||||
$this->readDgg();
|
||||
break;
|
||||
case self::BSTORECONTAINER:
|
||||
$this->readBstoreContainer();
|
||||
break;
|
||||
case self::BSE:
|
||||
$this->readBSE();
|
||||
break;
|
||||
case self::BLIPJPEG:
|
||||
$this->readBlipJPEG();
|
||||
break;
|
||||
case self::BLIPPNG:
|
||||
$this->readBlipPNG();
|
||||
break;
|
||||
case self::OPT:
|
||||
$this->readOPT();
|
||||
break;
|
||||
case self::TERTIARYOPT:
|
||||
$this->readTertiaryOPT();
|
||||
break;
|
||||
case self::SPLITMENUCOLORS:
|
||||
$this->readSplitMenuColors();
|
||||
break;
|
||||
case self::DGCONTAINER:
|
||||
$this->readDgContainer();
|
||||
break;
|
||||
case self::DG:
|
||||
$this->readDg();
|
||||
break;
|
||||
case self::SPGRCONTAINER:
|
||||
$this->readSpgrContainer();
|
||||
break;
|
||||
case self::SPCONTAINER:
|
||||
$this->readSpContainer();
|
||||
break;
|
||||
case self::SPGR:
|
||||
$this->readSpgr();
|
||||
break;
|
||||
case self::SP:
|
||||
$this->readSp();
|
||||
break;
|
||||
case self::CLIENTTEXTBOX:
|
||||
$this->readClientTextbox();
|
||||
break;
|
||||
case self::CLIENTANCHOR:
|
||||
$this->readClientAnchor();
|
||||
break;
|
||||
case self::CLIENTDATA:
|
||||
$this->readClientData();
|
||||
break;
|
||||
default:
|
||||
$this->readDefault();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_object;
|
||||
return $this->object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a generic record
|
||||
*/
|
||||
private function _readDefault()
|
||||
private function readDefault()
|
||||
{
|
||||
// offset 0; size: 2; recVer and recInstance
|
||||
$verInstance = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos);
|
||||
$verInstance = PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos);
|
||||
|
||||
// offset: 2; size: 2: Record Type
|
||||
$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2);
|
||||
$fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos + 2);
|
||||
|
||||
// bit: 0-3; mask: 0x000F; recVer
|
||||
$recVer = (0x000F & $verInstance) >> 0;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read DggContainer record (Drawing Group Container)
|
||||
*/
|
||||
private function _readDggContainer()
|
||||
private function readDggContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// record is a container, read contents
|
||||
$dggContainer = new PHPExcel_Shared_Escher_DggContainer();
|
||||
$this->_object->setDggContainer($dggContainer);
|
||||
$this->object->setDggContainer($dggContainer);
|
||||
$reader = new PHPExcel_Reader_Excel5_Escher($dggContainer);
|
||||
$reader->load($recordData);
|
||||
}
|
||||
|
@ -179,29 +209,29 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
/**
|
||||
* Read Dgg record (Drawing Group)
|
||||
*/
|
||||
private function _readDgg()
|
||||
private function readDgg()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read BstoreContainer record (Blip Store Container)
|
||||
*/
|
||||
private function _readBstoreContainer()
|
||||
private function readBstoreContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// record is a container, read contents
|
||||
$bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer();
|
||||
$this->_object->setBstoreContainer($bstoreContainer);
|
||||
$this->object->setBstoreContainer($bstoreContainer);
|
||||
$reader = new PHPExcel_Reader_Excel5_Escher($bstoreContainer);
|
||||
$reader->load($recordData);
|
||||
}
|
||||
|
@ -209,22 +239,22 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
/**
|
||||
* Read BSE record
|
||||
*/
|
||||
private function _readBSE()
|
||||
private function readBSE()
|
||||
{
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// add BSE to BstoreContainer
|
||||
$BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE();
|
||||
$this->_object->addBSE($BSE);
|
||||
$this->object->addBSE($BSE);
|
||||
|
||||
$BSE->setBLIPType($recInstance);
|
||||
|
||||
|
@ -275,18 +305,18 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
/**
|
||||
* Read BlipJPEG record. Holds raw JPEG image data
|
||||
*/
|
||||
private function _readBlipJPEG()
|
||||
private function readBlipJPEG()
|
||||
{
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
$pos = 0;
|
||||
|
||||
|
@ -310,24 +340,24 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
$blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip();
|
||||
$blip->setData($data);
|
||||
|
||||
$this->_object->setBlip($blip);
|
||||
$this->object->setBlip($blip);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read BlipPNG record. Holds raw PNG image data
|
||||
*/
|
||||
private function _readBlipPNG()
|
||||
private function readBlipPNG()
|
||||
{
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
$pos = 0;
|
||||
|
||||
|
@ -351,71 +381,71 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
$blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip();
|
||||
$blip->setData($data);
|
||||
|
||||
$this->_object->setBlip($blip);
|
||||
$this->object->setBlip($blip);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read OPT record. This record may occur within DggContainer record or SpContainer
|
||||
*/
|
||||
private function _readOPT()
|
||||
private function readOPT()
|
||||
{
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
$this->_readOfficeArtRGFOPTE($recordData, $recInstance);
|
||||
$this->readOfficeArtRGFOPTE($recordData, $recInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read TertiaryOPT record
|
||||
*/
|
||||
private function _readTertiaryOPT()
|
||||
private function readTertiaryOPT()
|
||||
{
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read SplitMenuColors record
|
||||
*/
|
||||
private function _readSplitMenuColors()
|
||||
private function readSplitMenuColors()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read DgContainer record (Drawing Container)
|
||||
*/
|
||||
private function _readDgContainer()
|
||||
private function readDgContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// record is a container, read contents
|
||||
$dgContainer = new PHPExcel_Shared_Escher_DgContainer();
|
||||
$this->_object->setDgContainer($dgContainer);
|
||||
$this->object->setDgContainer($dgContainer);
|
||||
$reader = new PHPExcel_Reader_Excel5_Escher($dgContainer);
|
||||
$escher = $reader->load($recordData);
|
||||
}
|
||||
|
@ -423,37 +453,37 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
/**
|
||||
* Read Dg record (Drawing)
|
||||
*/
|
||||
private function _readDg()
|
||||
private function readDg()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read SpgrContainer record (Shape Group Container)
|
||||
*/
|
||||
private function _readSpgrContainer()
|
||||
private function readSpgrContainer()
|
||||
{
|
||||
// context is either context DgContainer or SpgrContainer
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// record is a container, read contents
|
||||
$spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer();
|
||||
|
||||
if ($this->_object instanceof PHPExcel_Shared_Escher_DgContainer) {
|
||||
if ($this->object instanceof PHPExcel_Shared_Escher_DgContainer) {
|
||||
// DgContainer
|
||||
$this->_object->setSpgrContainer($spgrContainer);
|
||||
$this->object->setSpgrContainer($spgrContainer);
|
||||
} else {
|
||||
// SpgrContainer
|
||||
$this->_object->addChild($spgrContainer);
|
||||
$this->object->addChild($spgrContainer);
|
||||
}
|
||||
|
||||
$reader = new PHPExcel_Reader_Excel5_Escher($spgrContainer);
|
||||
|
@ -463,17 +493,17 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
/**
|
||||
* Read SpContainer record (Shape Container)
|
||||
*/
|
||||
private function _readSpContainer()
|
||||
private function readSpContainer()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// add spContainer to spgrContainer
|
||||
$spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer();
|
||||
$this->_object->addChild($spContainer);
|
||||
$this->object->addChild($spContainer);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// record is a container, read contents
|
||||
$reader = new PHPExcel_Reader_Excel5_Escher($spContainer);
|
||||
|
@ -483,59 +513,59 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
/**
|
||||
* Read Spgr record (Shape Group)
|
||||
*/
|
||||
private function _readSpgr()
|
||||
private function readSpgr()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read Sp record (Shape)
|
||||
*/
|
||||
private function _readSp()
|
||||
private function readSp()
|
||||
{
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read ClientTextbox record
|
||||
*/
|
||||
private function _readClientTextbox()
|
||||
private function readClientTextbox()
|
||||
{
|
||||
// offset: 0; size: 2; recVer and recInstance
|
||||
|
||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4;
|
||||
$recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->data, $this->pos)) >> 4;
|
||||
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read ClientAnchor record. This record holds information about where the shape is anchored in worksheet
|
||||
*/
|
||||
private function _readClientAnchor()
|
||||
private function readClientAnchor()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
|
||||
// offset: 2; size: 2; upper-left corner column index (0-based)
|
||||
$c1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 2);
|
||||
|
@ -562,34 +592,34 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
$endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16);
|
||||
|
||||
// set the start coordinates
|
||||
$this->_object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1));
|
||||
$this->object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1));
|
||||
|
||||
// set the start offsetX
|
||||
$this->_object->setStartOffsetX($startOffsetX);
|
||||
$this->object->setStartOffsetX($startOffsetX);
|
||||
|
||||
// set the start offsetY
|
||||
$this->_object->setStartOffsetY($startOffsetY);
|
||||
$this->object->setStartOffsetY($startOffsetY);
|
||||
|
||||
// set the end coordinates
|
||||
$this->_object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2) . ($r2 + 1));
|
||||
$this->object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2) . ($r2 + 1));
|
||||
|
||||
// set the end offsetX
|
||||
$this->_object->setEndOffsetX($endOffsetX);
|
||||
$this->object->setEndOffsetX($endOffsetX);
|
||||
|
||||
// set the end offsetY
|
||||
$this->_object->setEndOffsetY($endOffsetY);
|
||||
$this->object->setEndOffsetY($endOffsetY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read ClientData record
|
||||
*/
|
||||
private function _readClientData()
|
||||
private function readClientData()
|
||||
{
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4);
|
||||
$recordData = substr($this->_data, $this->_pos + 8, $length);
|
||||
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
|
||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||
|
||||
// move stream pointer to next record
|
||||
$this->_pos += 8 + $length;
|
||||
$this->pos += 8 + $length;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -598,8 +628,8 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
* @param string $data Binary data
|
||||
* @param int $n Number of properties
|
||||
*/
|
||||
private function _readOfficeArtRGFOPTE($data, $n) {
|
||||
|
||||
private function readOfficeArtRGFOPTE($data, $n)
|
||||
{
|
||||
$splicedComplexData = substr($data, 6 * $n);
|
||||
|
||||
// loop through property-value pairs
|
||||
|
@ -633,8 +663,7 @@ class PHPExcel_Reader_Excel5_Escher
|
|||
$value = $op;
|
||||
}
|
||||
|
||||
$this->_object->setOPT($opidOpid, $value);
|
||||
$this->object->setOPT($opidOpid, $value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_Excel5_MD5
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,15 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel5_MD5
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader_Excel5
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_Excel5_MD5
|
||||
{
|
||||
// Context
|
||||
|
@ -41,7 +33,6 @@ class PHPExcel_Reader_Excel5_MD5
|
|||
private $c;
|
||||
private $d;
|
||||
|
||||
|
||||
/**
|
||||
* MD5 stream constructor
|
||||
*/
|
||||
|
@ -50,7 +41,6 @@ class PHPExcel_Reader_Excel5_MD5
|
|||
$this->reset();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reset the MD5 stream context
|
||||
*/
|
||||
|
@ -62,7 +52,6 @@ class PHPExcel_Reader_Excel5_MD5
|
|||
$this->d = 0x10325476;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get MD5 stream context
|
||||
*
|
||||
|
@ -82,7 +71,6 @@ class PHPExcel_Reader_Excel5_MD5
|
|||
return $s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add data to context
|
||||
*
|
||||
|
@ -180,31 +168,26 @@ class PHPExcel_Reader_Excel5_MD5
|
|||
$this->d = ($this->d + $D) & 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
private static function F($X, $Y, $Z)
|
||||
{
|
||||
return (($X & $Y) | ((~ $X) & $Z)); // X AND Y OR NOT X AND Z
|
||||
}
|
||||
|
||||
|
||||
private static function G($X, $Y, $Z)
|
||||
{
|
||||
return (($X & $Z) | ($Y & (~ $Z))); // X AND Z OR Y AND NOT Z
|
||||
}
|
||||
|
||||
|
||||
private static function H($X, $Y, $Z)
|
||||
{
|
||||
return ($X ^ $Y ^ $Z); // X XOR Y XOR Z
|
||||
}
|
||||
|
||||
|
||||
private static function I($X, $Y, $Z)
|
||||
{
|
||||
return ($Y ^ ($X | (~ $Z))) ; // Y XOR (X OR NOT Z)
|
||||
}
|
||||
|
||||
|
||||
private static function step($func, &$A, $B, $C, $D, $M, $s, $t)
|
||||
{
|
||||
$A = ($A + call_user_func($func, $B, $C, $D) + $M + $t) & 0xffffffff;
|
||||
|
@ -212,7 +195,6 @@ class PHPExcel_Reader_Excel5_MD5
|
|||
$A = ($B + $A) & 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
private static function rotate($decimal, $bits)
|
||||
{
|
||||
$binary = str_pad(decbin($decimal), 32, "0", STR_PAD_LEFT);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Reader_Excel5_RC4
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,20 +25,12 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Excel5_RC4
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader_Excel5
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_Excel5_RC4
|
||||
{
|
||||
// Context
|
||||
var $s = array();
|
||||
var $i = 0;
|
||||
var $j = 0;
|
||||
protected $s = array();
|
||||
protected $i = 0;
|
||||
protected $j = 0;
|
||||
|
||||
/**
|
||||
* RC4 stream decryption/encryption constrcutor
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
<?php
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* PHPExcel
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Gnumeric
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,24 +34,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_Gnumeric
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
|
@ -49,27 +41,26 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_styles = array();
|
||||
private $styles = array();
|
||||
|
||||
/**
|
||||
* Shared Expressions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_expressions = array();
|
||||
|
||||
private $_referenceHelper = null;
|
||||
private $expressions = array();
|
||||
|
||||
private $referenceHelper = null;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Reader_Gnumeric
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
$this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance();
|
||||
$this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Can the current PHPExcel_Reader_IReader read the file?
|
||||
*
|
||||
|
@ -101,7 +92,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
|
||||
*
|
||||
|
@ -116,9 +106,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
}
|
||||
|
||||
$xml = new XMLReader();
|
||||
$xml->xml(
|
||||
$this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions()
|
||||
);
|
||||
$xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$xml->setParserProperty(2, true);
|
||||
|
||||
$worksheetNames = array();
|
||||
|
@ -135,7 +123,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
return $worksheetNames;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
|
||||
*
|
||||
|
@ -150,9 +137,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
}
|
||||
|
||||
$xml = new XMLReader();
|
||||
$xml->xml(
|
||||
$this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions()
|
||||
);
|
||||
$xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions());
|
||||
$xml->setParserProperty(2, true);
|
||||
|
||||
$worksheetInfo = array();
|
||||
|
@ -188,8 +173,8 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
return $worksheetInfo;
|
||||
}
|
||||
|
||||
|
||||
private function _gzfileGetContents($filename) {
|
||||
private function _gzfileGetContents($filename)
|
||||
{
|
||||
$file = @gzopen($filename, 'rb');
|
||||
if ($file !== false) {
|
||||
$data = '';
|
||||
|
@ -201,7 +186,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads PHPExcel from file
|
||||
*
|
||||
|
@ -218,7 +202,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
return $this->loadIntoExisting($pFilename, $objPHPExcel);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads PHPExcel from file into PHPExcel instance
|
||||
*
|
||||
|
@ -258,7 +241,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
$officeDocMetaXML = $officeDocXML->meta;
|
||||
|
||||
foreach ($officeDocMetaXML as $officePropertyData) {
|
||||
|
||||
$officePropertyDC = array();
|
||||
if (isset($namespacesMeta['dc'])) {
|
||||
$officePropertyDC = $officePropertyData->children($namespacesMeta['dc']);
|
||||
|
@ -374,7 +356,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
|
||||
if ((!$this->_readDataOnly) && (isset($sheet->PrintInformation))) {
|
||||
if (isset($sheet->PrintInformation->Margins)) {
|
||||
foreach ($sheet->PrintInformation->Margins->children('gnm',TRUE) as $key => $margin) {
|
||||
foreach ($sheet->PrintInformation->Margins->children('gnm', true) as $key => $margin) {
|
||||
$marginAttributes = $margin->attributes();
|
||||
$marginSize = 72 / 100; // Default
|
||||
switch ($marginAttributes['PrefUnit']) {
|
||||
|
@ -411,13 +393,17 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
$row = (int) $cellAttributes->Row + 1;
|
||||
$column = (int) $cellAttributes->Col;
|
||||
|
||||
if ($row > $maxRow) $maxRow = $row;
|
||||
if ($column > $maxCol) $maxCol = $column;
|
||||
if ($row > $maxRow) {
|
||||
$maxRow = $row;
|
||||
}
|
||||
if ($column > $maxCol) {
|
||||
$maxCol = $column;
|
||||
}
|
||||
|
||||
$column = PHPExcel_Cell::stringFromColumnIndex($column);
|
||||
|
||||
// Read cell?
|
||||
if ($this->getReadFilter() !== NULL) {
|
||||
if ($this->getReadFilter() !== null) {
|
||||
if (!$this->getReadFilter()->readCell($column, $row, $worksheetName)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -431,21 +417,16 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
$type = PHPExcel_Cell_DataType::TYPE_FORMULA;
|
||||
if ($ExprID > '') {
|
||||
if (((string) $cell) > '') {
|
||||
|
||||
$this->_expressions[$ExprID] = array( 'column' => $cellAttributes->Col,
|
||||
$this->expressions[$ExprID] = array(
|
||||
'column' => $cellAttributes->Col,
|
||||
'row' => $cellAttributes->Row,
|
||||
'formula' => (string) $cell
|
||||
);
|
||||
// echo 'NEW EXPRESSION ', $ExprID,'<br />';
|
||||
} else {
|
||||
$expression = $this->_expressions[$ExprID];
|
||||
$expression = $this->expressions[$ExprID];
|
||||
|
||||
$cell = $this->_referenceHelper->updateFormulaReferences( $expression['formula'],
|
||||
'A1',
|
||||
$cellAttributes->Col - $expression['column'],
|
||||
$cellAttributes->Row - $expression['row'],
|
||||
$worksheetName
|
||||
);
|
||||
$cell = $this->referenceHelper->updateFormulaReferences($expression['formula'], 'A1', $cellAttributes->Col - $expression['column'], $cellAttributes->Row - $expression['row'], $worksheetName);
|
||||
// echo 'SHARED EXPRESSION ', $ExprID,'<br />';
|
||||
// echo 'New Value is ', $cell,'<br />';
|
||||
}
|
||||
|
@ -457,7 +438,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
break;
|
||||
case '20': // Boolean
|
||||
$type = PHPExcel_Cell_DataType::TYPE_BOOL;
|
||||
$cell = ($cell == 'TRUE') ? True : False;
|
||||
$cell = ($cell == 'TRUE') ? true: false;
|
||||
break;
|
||||
case '30': // Integer
|
||||
$cell = intval($cell);
|
||||
|
@ -478,13 +459,11 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
}
|
||||
|
||||
if ((!$this->_readDataOnly) && (isset($sheet->Objects))) {
|
||||
foreach ($sheet->Objects->children('gnm',TRUE) as $key => $comment) {
|
||||
foreach ($sheet->Objects->children('gnm', true) as $key => $comment) {
|
||||
$commentAttributes = $comment->attributes();
|
||||
// Only comment objects are handled at the moment
|
||||
if ($commentAttributes->Text) {
|
||||
$objPHPExcel->getActiveSheet()->getComment( (string)$commentAttributes->ObjectBound )
|
||||
->setAuthor( (string)$commentAttributes->Author )
|
||||
->setText($this->_parseRichText((string)$commentAttributes->Text) );
|
||||
$objPHPExcel->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->_parseRichText((string)$commentAttributes->Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -494,7 +473,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
$styleAttributes = $styleRegion->attributes();
|
||||
if (($styleAttributes['startRow'] <= $maxRow) &&
|
||||
($styleAttributes['startCol'] <= $maxCol)) {
|
||||
|
||||
$startColumn = PHPExcel_Cell::stringFromColumnIndex((int) $styleAttributes['startCol']);
|
||||
$startRow = $styleAttributes['startRow'] + 1;
|
||||
|
||||
|
@ -553,8 +531,8 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
break;
|
||||
}
|
||||
|
||||
$styleArray['alignment']['wrap'] = ($styleAttributes['WrapText'] == '1') ? True : False;
|
||||
$styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? True : False;
|
||||
$styleArray['alignment']['wrap'] = ($styleAttributes['WrapText'] == '1') ? true : false;
|
||||
$styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? true : false;
|
||||
$styleArray['alignment']['indent'] = (intval($styleAttributes["Indent"]) > 0) ? $styleAttributes["indent"] : 0;
|
||||
|
||||
$RGB = self::_parseGnumericColour($styleAttributes["Fore"]);
|
||||
|
@ -634,9 +612,9 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
// echo '<br />';
|
||||
$styleArray['font']['name'] = (string) $styleRegion->Style->Font;
|
||||
$styleArray['font']['size'] = intval($fontAttributes['Unit']);
|
||||
$styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? True : False;
|
||||
$styleArray['font']['italic'] = ($fontAttributes['Italic'] == '1') ? True : False;
|
||||
$styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? True : False;
|
||||
$styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? true : false;
|
||||
$styleArray['font']['italic'] = ($fontAttributes['Italic'] == '1') ? true : false;
|
||||
$styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false;
|
||||
switch ($fontAttributes['Underline']) {
|
||||
case '1':
|
||||
$styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLE;
|
||||
|
@ -656,10 +634,10 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
}
|
||||
switch ($fontAttributes['Script']) {
|
||||
case '1':
|
||||
$styleArray['font']['superScript'] = True;
|
||||
$styleArray['font']['superScript'] = true;
|
||||
break;
|
||||
case '-1':
|
||||
$styleArray['font']['subScript'] = True;
|
||||
$styleArray['font']['subScript'] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -761,7 +739,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
// Handle Merged Cells in this worksheet
|
||||
if (isset($sheet->MergedRegions)) {
|
||||
foreach ($sheet->MergedRegions->Merge as $mergeCells) {
|
||||
if (strpos($mergeCells,':') !== FALSE) {
|
||||
if (strpos($mergeCells, ':') !== false) {
|
||||
$objPHPExcel->getActiveSheet()->mergeCells($mergeCells);
|
||||
}
|
||||
}
|
||||
|
@ -780,7 +758,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
}
|
||||
|
||||
$range = explode('!', $range);
|
||||
$range[0] = trim($range[0],"'");;
|
||||
$range[0] = trim($range[0], "'");
|
||||
if ($worksheet = $objPHPExcel->getSheetByName($range[0])) {
|
||||
$extractedRange = str_replace('$', '', $range[1]);
|
||||
$objPHPExcel->addNamedRange(new PHPExcel_NamedRange($name, $worksheet, $extractedRange));
|
||||
|
@ -788,12 +766,10 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Return
|
||||
return $objPHPExcel;
|
||||
}
|
||||
|
||||
|
||||
private static function _parseBorderAttributes($borderAttributes)
|
||||
{
|
||||
$styleArray = array();
|
||||
|
@ -850,8 +826,8 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
return $styleArray;
|
||||
}
|
||||
|
||||
|
||||
private function _parseRichText($is = '') {
|
||||
private function _parseRichText($is = '')
|
||||
{
|
||||
$value = new PHPExcel_RichText();
|
||||
|
||||
$value->createText($is);
|
||||
|
@ -859,8 +835,8 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
return $value;
|
||||
}
|
||||
|
||||
|
||||
private static function _parseGnumericColour($gnmColour) {
|
||||
private static function _parseGnumericColour($gnmColour)
|
||||
{
|
||||
list($gnmR, $gnmG, $gnmB) = explode(':', $gnmColour);
|
||||
$gnmR = substr(str_pad($gnmR, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||
$gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2);
|
||||
|
@ -869,5 +845,4 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
|
|||
// echo 'Excel Colour: ', $RGB,'<br />';
|
||||
return $RGB;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
<?php
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* PHPExcel
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_OOCalc
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,24 +34,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
|
||||
/** PHPExcel root directory */
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
|
||||
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* PHPExcel_Reader_OOCalc
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Reader
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
|
||||
{
|
||||
/**
|
||||
|
@ -49,17 +41,16 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_styles = array();
|
||||
|
||||
private $styles = array();
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Reader_OOCalc
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Can the current PHPExcel_Reader_IReader read the file?
|
||||
*
|
||||
|
@ -77,7 +68,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
$zipClass = PHPExcel_Settings::getZipClass();
|
||||
|
||||
// Check if zip class exists
|
||||
// if (!class_exists($zipClass, FALSE)) {
|
||||
// if (!class_exists($zipClass, false)) {
|
||||
// throw new PHPExcel_Reader_Exception($zipClass . " library is not enabled");
|
||||
// }
|
||||
|
||||
|
@ -109,7 +100,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
return ($mimeType === 'application/vnd.oasis.opendocument.spreadsheet');
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,11 +135,12 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
while ($xml->read()) {
|
||||
// Quickly jump through to the office:body node
|
||||
while ($xml->name !== 'office:body') {
|
||||
if ($xml->isEmptyElement)
|
||||
if ($xml->isEmptyElement) {
|
||||
$xml->read();
|
||||
else
|
||||
} else {
|
||||
$xml->next();
|
||||
}
|
||||
}
|
||||
// Now read each node until we find our first table:table node
|
||||
while ($xml->read()) {
|
||||
if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) {
|
||||
|
@ -164,7 +156,6 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
return $worksheetNames;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
|
||||
*
|
||||
|
@ -196,11 +187,12 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
while ($xml->read()) {
|
||||
// Quickly jump through to the office:body node
|
||||
while ($xml->name !== 'office:body') {
|
||||
if ($xml->isEmptyElement)
|
||||
if ($xml->isEmptyElement) {
|
||||
$xml->read();
|
||||
else
|
||||
} else {
|
||||
$xml->next();
|
||||
}
|
||||
}
|
||||
// Now read each node until we find our first table:table node
|
||||
while ($xml->read()) {
|
||||
if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) {
|
||||
|
@ -289,7 +281,6 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
return $worksheetInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads PHPExcel from file
|
||||
*
|
||||
|
@ -306,8 +297,8 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
return $this->loadIntoExisting($pFilename, $objPHPExcel);
|
||||
}
|
||||
|
||||
|
||||
private static function identifyFixedStyleValue($styleList,&$styleAttributeValue) {
|
||||
private static function identifyFixedStyleValue($styleList, &$styleAttributeValue)
|
||||
{
|
||||
$styleAttributeValue = strtolower($styleAttributeValue);
|
||||
foreach ($styleList as $style) {
|
||||
if ($styleAttributeValue == strtolower($style)) {
|
||||
|
@ -318,7 +309,6 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads PHPExcel from file into PHPExcel instance
|
||||
*
|
||||
|
@ -476,20 +466,17 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
}
|
||||
case 'table-row':
|
||||
$rowDataTableAttributes = $rowData->attributes($namespacesContent['table']);
|
||||
$rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ?
|
||||
$rowDataTableAttributes['number-rows-repeated'] : 1;
|
||||
$rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ? $rowDataTableAttributes['number-rows-repeated'] : 1;
|
||||
$columnID = 'A';
|
||||
foreach ($rowData as $key => $cellData) {
|
||||
if ($this->getReadFilter() !== NULL) {
|
||||
if ($this->getReadFilter() !== null) {
|
||||
if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// echo '<b>'.$columnID.$rowID.'</b><br />';
|
||||
$cellDataText = (isset($namespacesContent['text'])) ?
|
||||
$cellData->children($namespacesContent['text']) :
|
||||
'';
|
||||
$cellDataText = (isset($namespacesContent['text'])) ? $cellData->children($namespacesContent['text']) : '';
|
||||
$cellDataOffice = $cellData->children($namespacesContent['office']);
|
||||
$cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']);
|
||||
$cellDataTableAttributes = $cellData->attributes($namespacesContent['table']);
|
||||
|
@ -525,9 +512,8 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
}
|
||||
$text = implode("\n", $textArray);
|
||||
// echo $text, '<br />';
|
||||
$objPHPExcel->getActiveSheet()->getComment( $columnID.$rowID )
|
||||
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text));
|
||||
// ->setAuthor( $author )
|
||||
->setText($this->_parseRichText($text) );
|
||||
}
|
||||
|
||||
if (isset($cellDataText->p)) {
|
||||
|
@ -564,7 +550,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
break;
|
||||
case 'boolean':
|
||||
$type = PHPExcel_Cell_DataType::TYPE_BOOL;
|
||||
$dataValue = ($allCellDataText == 'TRUE') ? True : False;
|
||||
$dataValue = ($allCellDataText == 'TRUE') ? true : false;
|
||||
break;
|
||||
case 'percentage':
|
||||
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
|
||||
|
@ -586,11 +572,12 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
|
||||
$dataValue = (float) $cellDataOfficeAttributes['value'];
|
||||
if (floor($dataValue) == $dataValue) {
|
||||
if ($dataValue == (integer) $dataValue)
|
||||
if ($dataValue == (integer) $dataValue) {
|
||||
$dataValue = (integer) $dataValue;
|
||||
else
|
||||
} else {
|
||||
$dataValue = (float) $dataValue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'date':
|
||||
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
|
||||
|
@ -611,12 +598,12 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
break;
|
||||
}
|
||||
// echo 'Data value is '.$dataValue.'<br />';
|
||||
// if ($hyperlink !== NULL) {
|
||||
// if ($hyperlink !== null) {
|
||||
// echo 'Hyperlink is '.$hyperlink.'<br />';
|
||||
// }
|
||||
} else {
|
||||
$type = PHPExcel_Cell_DataType::TYPE_NULL;
|
||||
$dataValue = NULL;
|
||||
$dataValue = null;
|
||||
}
|
||||
|
||||
if ($hasCalculatedValue) {
|
||||
|
@ -641,9 +628,8 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
// echo 'Adjusted Formula: ', $cellDataFormula, PHP_EOL;
|
||||
}
|
||||
|
||||
$colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ?
|
||||
$cellDataTableAttributes['number-columns-repeated'] : 1;
|
||||
if ($type !== NULL) {
|
||||
$colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ? $cellDataTableAttributes['number-columns-repeated'] : 1;
|
||||
if ($type !== null) {
|
||||
for ($i = 0; $i < $colRepeats; ++$i) {
|
||||
if ($i > 0) {
|
||||
++$columnID;
|
||||
|
@ -656,12 +642,12 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
// echo 'Forumla result is '.$dataValue.'<br />';
|
||||
$objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue);
|
||||
}
|
||||
if ($formatting !== NULL) {
|
||||
if ($formatting !== null) {
|
||||
$objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting);
|
||||
} else {
|
||||
$objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_GENERAL);
|
||||
}
|
||||
if ($hyperlink !== NULL) {
|
||||
if ($hyperlink !== null) {
|
||||
$objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink);
|
||||
}
|
||||
}
|
||||
|
@ -699,13 +685,12 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
|
|||
return $objPHPExcel;
|
||||
}
|
||||
|
||||
|
||||
private function _parseRichText($is = '') {
|
||||
private function parseRichText($is = '')
|
||||
{
|
||||
$value = new PHPExcel_RichText();
|
||||
|
||||
$value->createText($is);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,33 +49,34 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_inputEncoding = 'ANSI';
|
||||
private $inputEncoding = 'ANSI';
|
||||
|
||||
/**
|
||||
* Sheet index to read
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_sheetIndex = 0;
|
||||
private $sheetIndex = 0;
|
||||
|
||||
/**
|
||||
* Formats
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_formats = array();
|
||||
private $formats = array();
|
||||
|
||||
/**
|
||||
* Format Count
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_format = 0;
|
||||
private $format = 0;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Reader_SYLK
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
|
||||
}
|
||||
|
||||
|
@ -92,16 +93,16 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
// Count delimiters in file
|
||||
$delimiterCount = substr_count($data, ';');
|
||||
if ($delimiterCount < 1) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Analyze first line looking for ID; signature
|
||||
$lines = explode("\n", $data);
|
||||
if (substr($lines[0], 0, 4) != 'ID;P') {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,7 +112,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
*/
|
||||
public function setInputEncoding($pValue = 'ANSI')
|
||||
{
|
||||
$this->_inputEncoding = $pValue;
|
||||
$this->inputEncoding = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -122,7 +123,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
*/
|
||||
public function getInputEncoding()
|
||||
{
|
||||
return $this->_inputEncoding;
|
||||
return $this->inputEncoding;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,7 +155,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
|
||||
// loop through one row (line) at a time in the file
|
||||
$rowIndex = 0;
|
||||
while (($rowData = fgets($fileHandle)) !== FALSE) {
|
||||
while (($rowData = fgets($fileHandle)) !== false) {
|
||||
$columnIndex = 0;
|
||||
|
||||
// convert SYLK encoded $rowData to UTF-8
|
||||
|
@ -230,10 +231,10 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
rewind($fileHandle);
|
||||
|
||||
// Create new PHPExcel
|
||||
while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) {
|
||||
while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
|
||||
$objPHPExcel->createSheet();
|
||||
}
|
||||
$objPHPExcel->setActiveSheetIndex( $this->_sheetIndex );
|
||||
$objPHPExcel->setActiveSheetIndex($this->sheetIndex);
|
||||
|
||||
$fromFormats = array('\-', '\ ');
|
||||
$toFormats = array('-', ' ');
|
||||
|
@ -243,8 +244,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
$column = $row = '';
|
||||
|
||||
// loop through one row (line) at a time in the file
|
||||
while (($rowData = fgets($fileHandle)) !== FALSE) {
|
||||
|
||||
while (($rowData = fgets($fileHandle)) !== false) {
|
||||
// convert SYLK encoded $rowData to UTF-8
|
||||
$rowData = PHPExcel_Shared_String::SYLKtoUTF8($rowData);
|
||||
|
||||
|
@ -258,34 +258,44 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
$formatArray = array();
|
||||
foreach ($rowData as $rowDatum) {
|
||||
switch ($rowDatum{0}) {
|
||||
case 'P' : $formatArray['numberformat']['code'] = str_replace($fromFormats, $toFormats,substr($rowDatum,1));
|
||||
case 'P':
|
||||
$formatArray['numberformat']['code'] = str_replace($fromFormats, $toFormats, substr($rowDatum, 1));
|
||||
break;
|
||||
case 'E':
|
||||
case 'F' : $formatArray['font']['name'] = substr($rowDatum,1);
|
||||
case 'F':
|
||||
$formatArray['font']['name'] = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'L' : $formatArray['font']['size'] = substr($rowDatum,1);
|
||||
case 'L':
|
||||
$formatArray['font']['size'] = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'S' : $styleSettings = substr($rowDatum,1);
|
||||
case 'S':
|
||||
$styleSettings = substr($rowDatum, 1);
|
||||
for ($i=0; $i<strlen($styleSettings); ++$i) {
|
||||
switch ($styleSettings{$i}) {
|
||||
case 'I' : $formatArray['font']['italic'] = true;
|
||||
case 'I':
|
||||
$formatArray['font']['italic'] = true;
|
||||
break;
|
||||
case 'D' : $formatArray['font']['bold'] = true;
|
||||
case 'D':
|
||||
$formatArray['font']['bold'] = true;
|
||||
break;
|
||||
case 'T' : $formatArray['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'T':
|
||||
$formatArray['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
case 'B' : $formatArray['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'B':
|
||||
$formatArray['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
case 'L' : $formatArray['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'L':
|
||||
$formatArray['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
case 'R' : $formatArray['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'R':
|
||||
$formatArray['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->_formats['P'.$this->_format++] = $formatArray;
|
||||
$this->formats['P'.$this->format++] = $formatArray;
|
||||
// Read cell value data
|
||||
} elseif ($dataType == 'C') {
|
||||
$hasCalculatedValue = false;
|
||||
|
@ -293,14 +303,18 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
foreach ($rowData as $rowDatum) {
|
||||
switch ($rowDatum{0}) {
|
||||
case 'C':
|
||||
case 'X' : $column = substr($rowDatum,1);
|
||||
case 'X':
|
||||
$column = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'R':
|
||||
case 'Y' : $row = substr($rowDatum,1);
|
||||
case 'Y':
|
||||
$row = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'K' : $cellData = substr($rowDatum,1);
|
||||
case 'K':
|
||||
$cellData = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'E' : $cellDataFormula = '='.substr($rowDatum,1);
|
||||
case 'E':
|
||||
$cellDataFormula = '='.substr($rowDatum, 1);
|
||||
// Convert R1C1 style references to A1 style references (but only when not quoted)
|
||||
$temp = explode('"', $cellDataFormula);
|
||||
$key = false;
|
||||
|
@ -317,14 +331,22 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
foreach ($cellReferences as $cellReference) {
|
||||
$rowReference = $cellReference[2][0];
|
||||
// Empty R reference is the current row
|
||||
if ($rowReference == '') $rowReference = $row;
|
||||
if ($rowReference == '') {
|
||||
$rowReference = $row;
|
||||
}
|
||||
// Bracketed R references are relative to the current row
|
||||
if ($rowReference{0} == '[') $rowReference = $row + trim($rowReference,'[]');
|
||||
if ($rowReference{0} == '[') {
|
||||
$rowReference = $row + trim($rowReference, '[]');
|
||||
}
|
||||
$columnReference = $cellReference[4][0];
|
||||
// Empty C reference is the current column
|
||||
if ($columnReference == '') $columnReference = $column;
|
||||
if ($columnReference == '') {
|
||||
$columnReference = $column;
|
||||
}
|
||||
// Bracketed C references are relative to the current column
|
||||
if ($columnReference{0} == '[') $columnReference = $column + trim($columnReference,'[]');
|
||||
if ($columnReference{0} == '[') {
|
||||
$columnReference = $column + trim($columnReference, '[]');
|
||||
}
|
||||
$A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference;
|
||||
|
||||
$value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
|
||||
|
@ -339,12 +361,12 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
}
|
||||
}
|
||||
$columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1);
|
||||
$cellData = PHPExcel_Calculation::_unwrapResult($cellData);
|
||||
$cellData = PHPExcel_Calculation::unwrapResult($cellData);
|
||||
|
||||
// Set cell value
|
||||
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
|
||||
if ($hasCalculatedValue) {
|
||||
$cellData = PHPExcel_Calculation::_unwrapResult($cellData);
|
||||
$cellData = PHPExcel_Calculation::unwrapResult($cellData);
|
||||
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData);
|
||||
}
|
||||
// Read cell formatting
|
||||
|
@ -354,29 +376,40 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
foreach ($rowData as $rowDatum) {
|
||||
switch ($rowDatum{0}) {
|
||||
case 'C':
|
||||
case 'X' : $column = substr($rowDatum,1);
|
||||
case 'X':
|
||||
$column = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'R':
|
||||
case 'Y' : $row = substr($rowDatum,1);
|
||||
case 'Y':
|
||||
$row = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'P' : $formatStyle = $rowDatum;
|
||||
case 'P':
|
||||
$formatStyle = $rowDatum;
|
||||
break;
|
||||
case 'W' : list($startCol, $endCol, $columnWidth) = explode(' ',substr($rowDatum,1));
|
||||
case 'W':
|
||||
list($startCol, $endCol, $columnWidth) = explode(' ', substr($rowDatum, 1));
|
||||
break;
|
||||
case 'S' : $styleSettings = substr($rowDatum,1);
|
||||
case 'S':
|
||||
$styleSettings = substr($rowDatum, 1);
|
||||
for ($i=0; $i<strlen($styleSettings); ++$i) {
|
||||
switch ($styleSettings{$i}) {
|
||||
case 'I' : $styleData['font']['italic'] = true;
|
||||
case 'I':
|
||||
$styleData['font']['italic'] = true;
|
||||
break;
|
||||
case 'D' : $styleData['font']['bold'] = true;
|
||||
case 'D':
|
||||
$styleData['font']['bold'] = true;
|
||||
break;
|
||||
case 'T' : $styleData['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'T':
|
||||
$styleData['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
case 'B' : $styleData['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'B':
|
||||
$styleData['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
case 'L' : $styleData['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'L':
|
||||
$styleData['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
case 'R' : $styleData['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
case 'R':
|
||||
$styleData['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -385,8 +418,8 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
}
|
||||
if (($formatStyle > '') && ($column > '') && ($row > '')) {
|
||||
$columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1);
|
||||
if (isset($this->_formats[$formatStyle])) {
|
||||
$objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->_formats[$formatStyle]);
|
||||
if (isset($this->formats[$formatStyle])) {
|
||||
$objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]);
|
||||
}
|
||||
}
|
||||
if ((!empty($styleData)) && ($column > '') && ($row > '')) {
|
||||
|
@ -410,10 +443,12 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
foreach ($rowData as $rowDatum) {
|
||||
switch ($rowDatum{0}) {
|
||||
case 'C':
|
||||
case 'X' : $column = substr($rowDatum,1);
|
||||
case 'X':
|
||||
$column = substr($rowDatum, 1);
|
||||
break;
|
||||
case 'R':
|
||||
case 'Y' : $row = substr($rowDatum,1);
|
||||
case 'Y':
|
||||
$row = substr($rowDatum, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -432,8 +467,9 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSheetIndex() {
|
||||
return $this->_sheetIndex;
|
||||
public function getSheetIndex()
|
||||
{
|
||||
return $this->sheetIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -442,9 +478,9 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
|
|||
* @param int $pValue Sheet index
|
||||
* @return PHPExcel_Reader_SYLK
|
||||
*/
|
||||
public function setSheetIndex($pValue = 0) {
|
||||
$this->_sheetIndex = $pValue;
|
||||
public function setSheetIndex($pValue = 0)
|
||||
{
|
||||
$this->sheetIndex = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class PHPExcel_ReferenceHelper
|
|||
*
|
||||
* @var PHPExcel_ReferenceHelper
|
||||
*/
|
||||
private static $_instance;
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Get an instance of this class
|
||||
|
@ -48,11 +48,11 @@ class PHPExcel_ReferenceHelper
|
|||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
if (!isset(self::$_instance) || (self::$_instance === null)) {
|
||||
self::$_instance = new PHPExcel_ReferenceHelper();
|
||||
if (!isset(self::$instance) || (self::$instance === null)) {
|
||||
self::$instance = new PHPExcel_ReferenceHelper();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustPageBreaks(PHPExcel_Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustPageBreaks(PHPExcel_Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aBreaks = $pSheet->getBreaks();
|
||||
($pNumCols > 0 || $pNumRows > 0) ?
|
||||
|
@ -197,7 +197,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aComments = $pSheet->getComments();
|
||||
$aNewComments = array(); // the new array of all comments
|
||||
|
@ -224,7 +224,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aHyperlinkCollection = $pSheet->getHyperlinkCollection();
|
||||
($pNumCols > 0 || $pNumRows > 0) ? uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellSort'));
|
||||
|
@ -248,7 +248,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aDataValidationCollection = $pSheet->getDataValidationCollection();
|
||||
($pNumCols > 0 || $pNumRows > 0) ? uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellSort'));
|
||||
|
@ -272,7 +272,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aMergeCells = $pSheet->getMergeCells();
|
||||
$aNewMergeCells = array(); // the new array of all merge cells
|
||||
|
@ -293,7 +293,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aProtectedCells = $pSheet->getProtectedCells();
|
||||
($pNumCols > 0 || $pNumRows > 0) ?
|
||||
|
@ -318,7 +318,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aColumnDimensions = array_reverse($pSheet->getColumnDimensions(), true);
|
||||
if (!empty($aColumnDimensions)) {
|
||||
|
@ -343,7 +343,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @param integer $beforeRow Number of the row we're inserting/deleting before
|
||||
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
|
||||
*/
|
||||
protected function _adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
protected function adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
|
||||
{
|
||||
$aRowDimensions = array_reverse($pSheet->getRowDimensions(), true);
|
||||
if (!empty($aRowDimensions)) {
|
||||
|
@ -513,28 +513,28 @@ class PHPExcel_ReferenceHelper
|
|||
}
|
||||
|
||||
// Update worksheet: column dimensions
|
||||
$this->_adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: row dimensions
|
||||
$this->_adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: page breaks
|
||||
$this->_adjustPageBreaks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustPageBreaks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: comments
|
||||
$this->_adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: hyperlinks
|
||||
$this->_adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: data validations
|
||||
$this->_adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: merge cells
|
||||
$this->_adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: protected cells
|
||||
$this->_adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
$this->adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
|
||||
|
||||
// Update worksheet: autofilter
|
||||
$autoFilter = $pSheet->getAutoFilter();
|
||||
|
@ -785,10 +785,10 @@ class PHPExcel_ReferenceHelper
|
|||
// Is it a range or a single cell?
|
||||
} elseif (strpos($pCellRange, ':') === false && strpos($pCellRange, ',') === false) {
|
||||
// Single cell
|
||||
return $this->_updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows);
|
||||
return $this->updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows);
|
||||
} elseif (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {
|
||||
// Range
|
||||
return $this->_updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows);
|
||||
return $this->updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows);
|
||||
} else {
|
||||
// Return original
|
||||
return $pCellRange;
|
||||
|
@ -833,7 +833,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @return string Updated cell range
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
private function _updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
|
||||
private function updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
|
||||
{
|
||||
if (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {
|
||||
// Update range
|
||||
|
@ -843,13 +843,13 @@ class PHPExcel_ReferenceHelper
|
|||
$jc = count($range[$i]);
|
||||
for ($j = 0; $j < $jc; ++$j) {
|
||||
if (ctype_alpha($range[$i][$j])) {
|
||||
$r = PHPExcel_Cell::coordinateFromString($this->_updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows));
|
||||
$r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows));
|
||||
$range[$i][$j] = $r[0];
|
||||
} elseif (ctype_digit($range[$i][$j])) {
|
||||
$r = PHPExcel_Cell::coordinateFromString($this->_updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows));
|
||||
$r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows));
|
||||
$range[$i][$j] = $r[1];
|
||||
} else {
|
||||
$range[$i][$j] = $this->_updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
|
||||
$range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -871,7 +871,7 @@ class PHPExcel_ReferenceHelper
|
|||
* @return string Updated cell reference
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
private function _updateSingleCellReference($pCellReference = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
|
||||
private function updateSingleCellReference($pCellReference = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
|
||||
{
|
||||
if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) {
|
||||
// Get coordinates of $pBefore
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher
|
||||
{
|
||||
/**
|
||||
|
@ -39,14 +32,14 @@ class PHPExcel_Shared_Escher
|
|||
*
|
||||
* @var PHPExcel_Shared_Escher_DggContainer
|
||||
*/
|
||||
private $_dggContainer;
|
||||
private $dggContainer;
|
||||
|
||||
/**
|
||||
* Drawing Container
|
||||
*
|
||||
* @var PHPExcel_Shared_Escher_DgContainer
|
||||
*/
|
||||
private $_dgContainer;
|
||||
private $dgContainer;
|
||||
|
||||
/**
|
||||
* Get Drawing Group Container
|
||||
|
@ -55,7 +48,7 @@ class PHPExcel_Shared_Escher
|
|||
*/
|
||||
public function getDggContainer()
|
||||
{
|
||||
return $this->_dggContainer;
|
||||
return $this->dggContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +58,7 @@ class PHPExcel_Shared_Escher
|
|||
*/
|
||||
public function setDggContainer($dggContainer)
|
||||
{
|
||||
return $this->_dggContainer = $dggContainer;
|
||||
return $this->dggContainer = $dggContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +68,7 @@ class PHPExcel_Shared_Escher
|
|||
*/
|
||||
public function getDgContainer()
|
||||
{
|
||||
return $this->_dgContainer;
|
||||
return $this->dgContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,6 +78,6 @@ class PHPExcel_Shared_Escher
|
|||
*/
|
||||
public function setDgContainer($dgContainer)
|
||||
{
|
||||
return $this->_dgContainer = $dgContainer;
|
||||
return $this->dgContainer = $dgContainer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher_DgContainer
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher_DgContainer
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher_DgContainer
|
||||
{
|
||||
/**
|
||||
|
@ -39,44 +32,44 @@ class PHPExcel_Shared_Escher_DgContainer
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_dgId;
|
||||
private $dgId;
|
||||
|
||||
/**
|
||||
* Last shape index in this drawing
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_lastSpId;
|
||||
private $lastSpId;
|
||||
|
||||
private $_spgrContainer = null;
|
||||
private $spgrContainer = null;
|
||||
|
||||
public function getDgId()
|
||||
{
|
||||
return $this->_dgId;
|
||||
return $this->dgId;
|
||||
}
|
||||
|
||||
public function setDgId($value)
|
||||
{
|
||||
$this->_dgId = $value;
|
||||
$this->dgId = $value;
|
||||
}
|
||||
|
||||
public function getLastSpId()
|
||||
{
|
||||
return $this->_lastSpId;
|
||||
return $this->lastSpId;
|
||||
}
|
||||
|
||||
public function setLastSpId($value)
|
||||
{
|
||||
$this->_lastSpId = $value;
|
||||
$this->lastSpId = $value;
|
||||
}
|
||||
|
||||
public function getSpgrContainer()
|
||||
{
|
||||
return $this->_spgrContainer;
|
||||
return $this->spgrContainer;
|
||||
}
|
||||
|
||||
public function setSpgrContainer($spgrContainer)
|
||||
{
|
||||
return $this->_spgrContainer = $spgrContainer;
|
||||
return $this->spgrContainer = $spgrContainer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
||||
{
|
||||
/**
|
||||
|
@ -39,14 +32,14 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
|||
*
|
||||
* @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
||||
*/
|
||||
private $_parent;
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
* Shape Container collection
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_children = array();
|
||||
private $children = array();
|
||||
|
||||
/**
|
||||
* Set parent Shape Group Container
|
||||
|
@ -55,7 +48,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
|||
*/
|
||||
public function setParent($parent)
|
||||
{
|
||||
$this->_parent = $parent;
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +58,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
|||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->_parent;
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +68,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
|||
*/
|
||||
public function addChild($child)
|
||||
{
|
||||
$this->_children[] = $child;
|
||||
$this->children[] = $child;
|
||||
$child->setParent($this);
|
||||
}
|
||||
|
||||
|
@ -84,7 +77,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
|||
*/
|
||||
public function getChildren()
|
||||
{
|
||||
return $this->_children;
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,7 +89,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
|||
{
|
||||
$allSpContainers = array();
|
||||
|
||||
foreach ($this->_children as $child) {
|
||||
foreach ($this->children as $child) {
|
||||
if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
|
||||
$allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers());
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
||||
{
|
||||
/**
|
||||
|
@ -39,84 +32,84 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*
|
||||
* @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer
|
||||
*/
|
||||
private $_parent;
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
* Is this a group shape?
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_spgr = false;
|
||||
private $spgr = false;
|
||||
|
||||
/**
|
||||
* Shape type
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_spType;
|
||||
private $spType;
|
||||
|
||||
/**
|
||||
* Shape flag
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_spFlag;
|
||||
private $spFlag;
|
||||
|
||||
/**
|
||||
* Shape index (usually group shape has index 0, and the rest: 1,2,3...)
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_spId;
|
||||
private $spId;
|
||||
|
||||
/**
|
||||
* Array of options
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_OPT;
|
||||
private $OPT;
|
||||
|
||||
/**
|
||||
* Cell coordinates of upper-left corner of shape, e.g. 'A1'
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_startCoordinates;
|
||||
private $startCoordinates;
|
||||
|
||||
/**
|
||||
* Horizontal offset of upper-left corner of shape measured in 1/1024 of column width
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_startOffsetX;
|
||||
private $startOffsetX;
|
||||
|
||||
/**
|
||||
* Vertical offset of upper-left corner of shape measured in 1/256 of row height
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_startOffsetY;
|
||||
private $startOffsetY;
|
||||
|
||||
/**
|
||||
* Cell coordinates of bottom-right corner of shape, e.g. 'B2'
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_endCoordinates;
|
||||
private $endCoordinates;
|
||||
|
||||
/**
|
||||
* Horizontal offset of bottom-right corner of shape measured in 1/1024 of column width
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_endOffsetX;
|
||||
private $endOffsetX;
|
||||
|
||||
/**
|
||||
* Vertical offset of bottom-right corner of shape measured in 1/256 of row height
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_endOffsetY;
|
||||
private $endOffsetY;
|
||||
|
||||
/**
|
||||
* Set parent Shape Group Container
|
||||
|
@ -125,7 +118,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setParent($parent)
|
||||
{
|
||||
$this->_parent = $parent;
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,7 +128,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->_parent;
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,7 +138,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setSpgr($value = false)
|
||||
{
|
||||
$this->_spgr = $value;
|
||||
$this->spgr = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -155,7 +148,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getSpgr()
|
||||
{
|
||||
return $this->_spgr;
|
||||
return $this->spgr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -165,7 +158,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setSpType($value)
|
||||
{
|
||||
$this->_spType = $value;
|
||||
$this->spType = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -175,7 +168,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getSpType()
|
||||
{
|
||||
return $this->_spType;
|
||||
return $this->spType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,7 +178,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setSpFlag($value)
|
||||
{
|
||||
$this->_spFlag = $value;
|
||||
$this->spFlag = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,7 +188,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getSpFlag()
|
||||
{
|
||||
return $this->_spFlag;
|
||||
return $this->spFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -205,7 +198,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setSpId($value)
|
||||
{
|
||||
$this->_spId = $value;
|
||||
$this->spId = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -215,7 +208,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getSpId()
|
||||
{
|
||||
return $this->_spId;
|
||||
return $this->spId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -226,7 +219,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setOPT($property, $value)
|
||||
{
|
||||
$this->_OPT[$property] = $value;
|
||||
$this->OPT[$property] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -237,8 +230,8 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getOPT($property)
|
||||
{
|
||||
if (isset($this->_OPT[$property])) {
|
||||
return $this->_OPT[$property];
|
||||
if (isset($this->OPT[$property])) {
|
||||
return $this->OPT[$property];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -250,7 +243,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getOPTCollection()
|
||||
{
|
||||
return $this->_OPT;
|
||||
return $this->OPT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -260,7 +253,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setStartCoordinates($value = 'A1')
|
||||
{
|
||||
$this->_startCoordinates = $value;
|
||||
$this->startCoordinates = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,7 +263,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getStartCoordinates()
|
||||
{
|
||||
return $this->_startCoordinates;
|
||||
return $this->startCoordinates;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -280,7 +273,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setStartOffsetX($startOffsetX = 0)
|
||||
{
|
||||
$this->_startOffsetX = $startOffsetX;
|
||||
$this->startOffsetX = $startOffsetX;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -290,7 +283,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getStartOffsetX()
|
||||
{
|
||||
return $this->_startOffsetX;
|
||||
return $this->startOffsetX;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -300,7 +293,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setStartOffsetY($startOffsetY = 0)
|
||||
{
|
||||
$this->_startOffsetY = $startOffsetY;
|
||||
$this->startOffsetY = $startOffsetY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -310,7 +303,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getStartOffsetY()
|
||||
{
|
||||
return $this->_startOffsetY;
|
||||
return $this->startOffsetY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -320,7 +313,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setEndCoordinates($value = 'A1')
|
||||
{
|
||||
$this->_endCoordinates = $value;
|
||||
$this->endCoordinates = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -330,7 +323,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getEndCoordinates()
|
||||
{
|
||||
return $this->_endCoordinates;
|
||||
return $this->endCoordinates;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -340,7 +333,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setEndOffsetX($endOffsetX = 0)
|
||||
{
|
||||
$this->_endOffsetX = $endOffsetX;
|
||||
$this->endOffsetX = $endOffsetX;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -350,7 +343,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getEndOffsetX()
|
||||
{
|
||||
return $this->_endOffsetX;
|
||||
return $this->endOffsetX;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -360,7 +353,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function setEndOffsetY($endOffsetY = 0)
|
||||
{
|
||||
$this->_endOffsetY = $endOffsetY;
|
||||
$this->endOffsetY = $endOffsetY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -370,7 +363,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
|
|||
*/
|
||||
public function getEndOffsetY()
|
||||
{
|
||||
return $this->_endOffsetY;
|
||||
return $this->endOffsetY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher_DggContainer
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher_DggContainer
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher_DggContainer
|
||||
{
|
||||
/**
|
||||
|
@ -39,42 +32,42 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_spIdMax;
|
||||
private $spIdMax;
|
||||
|
||||
/**
|
||||
* Total number of drawings saved
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_cDgSaved;
|
||||
private $cDgSaved;
|
||||
|
||||
/**
|
||||
* Total number of shapes saved (including group shapes)
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_cSpSaved;
|
||||
private $cSpSaved;
|
||||
|
||||
/**
|
||||
* BLIP Store Container
|
||||
*
|
||||
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer
|
||||
*/
|
||||
private $_bstoreContainer;
|
||||
private $bstoreContainer;
|
||||
|
||||
/**
|
||||
* Array of options for the drawing group
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_OPT = array();
|
||||
private $OPT = array();
|
||||
|
||||
/**
|
||||
* Array of identifier clusters containg information about the maximum shape identifiers
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_IDCLs = array();
|
||||
private $IDCLs = array();
|
||||
|
||||
/**
|
||||
* Get maximum shape index of all shapes in all drawings (plus one)
|
||||
|
@ -83,7 +76,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function getSpIdMax()
|
||||
{
|
||||
return $this->_spIdMax;
|
||||
return $this->spIdMax;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,7 +86,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function setSpIdMax($value)
|
||||
{
|
||||
$this->_spIdMax = $value;
|
||||
$this->spIdMax = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -103,7 +96,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function getCDgSaved()
|
||||
{
|
||||
return $this->_cDgSaved;
|
||||
return $this->cDgSaved;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -113,7 +106,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function setCDgSaved($value)
|
||||
{
|
||||
$this->_cDgSaved = $value;
|
||||
$this->cDgSaved = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -123,7 +116,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function getCSpSaved()
|
||||
{
|
||||
return $this->_cSpSaved;
|
||||
return $this->cSpSaved;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,7 +126,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function setCSpSaved($value)
|
||||
{
|
||||
$this->_cSpSaved = $value;
|
||||
$this->cSpSaved = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -143,7 +136,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function getBstoreContainer()
|
||||
{
|
||||
return $this->_bstoreContainer;
|
||||
return $this->bstoreContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -153,7 +146,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function setBstoreContainer($bstoreContainer)
|
||||
{
|
||||
$this->_bstoreContainer = $bstoreContainer;
|
||||
$this->bstoreContainer = $bstoreContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -164,7 +157,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function setOPT($property, $value)
|
||||
{
|
||||
$this->_OPT[$property] = $value;
|
||||
$this->OPT[$property] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -175,8 +168,8 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function getOPT($property)
|
||||
{
|
||||
if (isset($this->_OPT[$property])) {
|
||||
return $this->_OPT[$property];
|
||||
if (isset($this->OPT[$property])) {
|
||||
return $this->OPT[$property];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -188,7 +181,7 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function getIDCLs()
|
||||
{
|
||||
return $this->_IDCLs;
|
||||
return $this->IDCLs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -198,6 +191,6 @@ class PHPExcel_Shared_Escher_DggContainer
|
|||
*/
|
||||
public function setIDCLs($pValue)
|
||||
{
|
||||
$this->_IDCLs = $pValue;
|
||||
$this->IDCLs = $pValue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
|
||||
{
|
||||
/**
|
||||
|
@ -39,7 +32,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_BSECollection = array();
|
||||
private $BSECollection = array();
|
||||
|
||||
/**
|
||||
* Add a BLIP Store Entry
|
||||
|
@ -48,7 +41,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
|
|||
*/
|
||||
public function addBSE($BSE)
|
||||
{
|
||||
$this->_BSECollection[] = $BSE;
|
||||
$this->BSECollection[] = $BSE;
|
||||
$BSE->setParent($this);
|
||||
}
|
||||
|
||||
|
@ -59,6 +52,6 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
|
|||
*/
|
||||
public function getBSECollection()
|
||||
{
|
||||
return $this->_BSECollection;
|
||||
return $this->BSECollection;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
||||
{
|
||||
const BLIPTYPE_ERROR = 0x00;
|
||||
|
@ -57,14 +50,14 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
|||
*
|
||||
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
||||
*/
|
||||
private $_blip;
|
||||
private $blip;
|
||||
|
||||
/**
|
||||
* The BLIP type
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_blipType;
|
||||
private $blipType;
|
||||
|
||||
/**
|
||||
* Set parent BLIP Store Entry Container
|
||||
|
@ -83,7 +76,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
|||
*/
|
||||
public function getBlip()
|
||||
{
|
||||
return $this->_blip;
|
||||
return $this->blip;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,7 +86,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
|||
*/
|
||||
public function setBlip($blip)
|
||||
{
|
||||
$this->_blip = $blip;
|
||||
$this->blip = $blip;
|
||||
$blip->setParent($this);
|
||||
}
|
||||
|
||||
|
@ -104,7 +97,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
|||
*/
|
||||
public function getBlipType()
|
||||
{
|
||||
return $this->_blipType;
|
||||
return $this->blipType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -114,6 +107,6 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
|||
*/
|
||||
public function setBlipType($blipType)
|
||||
{
|
||||
$this->_blipType = $blipType;
|
||||
$this->blipType = $blipType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared_Escher
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
||||
{
|
||||
/**
|
||||
|
@ -39,14 +32,14 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
|||
*
|
||||
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
|
||||
*/
|
||||
private $_parent;
|
||||
private $parent;
|
||||
|
||||
/**
|
||||
* Raw image data
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_data;
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* Get the raw image data
|
||||
|
@ -55,7 +48,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
|||
*/
|
||||
public function getData()
|
||||
{
|
||||
return $this->_data;
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,7 +58,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
|||
*/
|
||||
public function setData($data)
|
||||
{
|
||||
$this->_data = $data;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +68,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
|||
*/
|
||||
public function setParent($parent)
|
||||
{
|
||||
$this->_parent = $parent;
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -85,6 +78,6 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
|
|||
*/
|
||||
public function getParent()
|
||||
{
|
||||
return $this->_parent;
|
||||
return $this->parent;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Shared_Excel5
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,14 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHPExcel_Shared_Excel5
|
||||
*
|
||||
* @category PHPExcel
|
||||
* @package PHPExcel_Shared
|
||||
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||
*/
|
||||
class PHPExcel_Shared_Excel5
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -39,7 +39,7 @@ class PHPExcel_Shared_Font
|
|||
const AUTOSIZE_METHOD_APPROX = 'approx';
|
||||
const AUTOSIZE_METHOD_EXACT = 'exact';
|
||||
|
||||
private static $_autoSizeMethods = array(
|
||||
private static $autoSizeMethods = array(
|
||||
self::AUTOSIZE_METHOD_APPROX,
|
||||
self::AUTOSIZE_METHOD_EXACT,
|
||||
);
|
||||
|
@ -196,7 +196,7 @@ class PHPExcel_Shared_Font
|
|||
*/
|
||||
public static function setAutoSizeMethod($pValue = self::AUTOSIZE_METHOD_APPROX)
|
||||
{
|
||||
if (!in_array($pValue, self::$_autoSizeMethods)) {
|
||||
if (!in_array($pValue, self::$autoSizeMethods)) {
|
||||
return false;
|
||||
}
|
||||
self::$autoSizeMethod = $pValue;
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
* @author Michael Bommarito
|
||||
* @version 1.2
|
||||
*/
|
||||
class CholeskyDecomposition {
|
||||
|
||||
class CholeskyDecomposition
|
||||
{
|
||||
/**
|
||||
* Decomposition storage
|
||||
* @var array
|
||||
|
@ -38,14 +38,14 @@ class CholeskyDecomposition {
|
|||
*/
|
||||
private $isspd = true;
|
||||
|
||||
|
||||
/**
|
||||
* CholeskyDecomposition
|
||||
*
|
||||
* Class constructor - decomposes symmetric positive definite matrix
|
||||
* @param mixed Matrix square symmetric positive definite matrix
|
||||
*/
|
||||
public function __construct($A = null) {
|
||||
public function __construct($A = null)
|
||||
{
|
||||
if ($A instanceof Matrix) {
|
||||
$this->L = $A->getArray();
|
||||
$this->m = $A->getRowDimension();
|
||||
|
@ -77,35 +77,35 @@ class CholeskyDecomposition {
|
|||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Is the matrix symmetric and positive definite?
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isSPD() {
|
||||
public function isSPD()
|
||||
{
|
||||
return $this->isspd;
|
||||
} // function isSPD()
|
||||
|
||||
|
||||
/**
|
||||
* getL
|
||||
*
|
||||
* Return triangular factor.
|
||||
* @return Matrix Lower triangular matrix
|
||||
*/
|
||||
public function getL() {
|
||||
public function getL()
|
||||
{
|
||||
return new Matrix($this->L);
|
||||
} // function getL()
|
||||
|
||||
|
||||
/**
|
||||
* Solve A*X = B
|
||||
*
|
||||
* @param $B Row-equal matrix
|
||||
* @return Matrix L * L' * X = B
|
||||
*/
|
||||
public function solve($B = null) {
|
||||
public function solve($B = null)
|
||||
{
|
||||
if ($B instanceof Matrix) {
|
||||
if ($B->getRowDimension() == $this->m) {
|
||||
if ($this->isspd) {
|
||||
|
@ -145,5 +145,4 @@ class CholeskyDecomposition {
|
|||
throw new PHPExcel_Calculation_Exception(JAMAError(ArgumentTypeException));
|
||||
}
|
||||
} // function solve()
|
||||
|
||||
} // class CholeskyDecomposition
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
* @license PHP v3.0
|
||||
* @version 1.1
|
||||
*/
|
||||
class EigenvalueDecomposition {
|
||||
|
||||
class EigenvalueDecomposition
|
||||
{
|
||||
/**
|
||||
* Row and column dimension (square matrix).
|
||||
* @var int
|
||||
|
@ -67,13 +67,13 @@ class EigenvalueDecomposition {
|
|||
private $cdivr;
|
||||
private $cdivi;
|
||||
|
||||
|
||||
/**
|
||||
* Symmetric Householder reduction to tridiagonal form.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function tred2 () {
|
||||
private function tred2()
|
||||
{
|
||||
// This is derived from the Algol procedures tred2 by
|
||||
// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
|
||||
// Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
|
||||
|
@ -171,7 +171,6 @@ class EigenvalueDecomposition {
|
|||
$this->e[0] = 0.0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Symmetric tridiagonal QL algorithm.
|
||||
*
|
||||
|
@ -182,7 +181,8 @@ class EigenvalueDecomposition {
|
|||
*
|
||||
* @access private
|
||||
*/
|
||||
private function tql2() {
|
||||
private function tql2()
|
||||
{
|
||||
for ($i = 1; $i < $this->n; ++$i) {
|
||||
$this->e[$i-1] = $this->e[$i];
|
||||
}
|
||||
|
@ -196,8 +196,9 @@ class EigenvalueDecomposition {
|
|||
$tst1 = max($tst1, abs($this->d[$l]) + abs($this->e[$l]));
|
||||
$m = $l;
|
||||
while ($m < $this->n) {
|
||||
if (abs($this->e[$m]) <= $eps * $tst1)
|
||||
if (abs($this->e[$m]) <= $eps * $tst1) {
|
||||
break;
|
||||
}
|
||||
++$m;
|
||||
}
|
||||
// If m == l, $this->d[l] is an eigenvalue,
|
||||
|
@ -211,14 +212,16 @@ class EigenvalueDecomposition {
|
|||
$g = $this->d[$l];
|
||||
$p = ($this->d[$l+1] - $g) / (2.0 * $this->e[$l]);
|
||||
$r = hypo($p, 1.0);
|
||||
if ($p < 0)
|
||||
if ($p < 0) {
|
||||
$r *= -1;
|
||||
}
|
||||
$this->d[$l] = $this->e[$l] / ($p + $r);
|
||||
$this->d[$l+1] = $this->e[$l] * ($p + $r);
|
||||
$dl1 = $this->d[$l+1];
|
||||
$h = $g - $this->d[$l];
|
||||
for ($i = $l + 2; $i < $this->n; ++$i)
|
||||
for ($i = $l + 2; $i < $this->n; ++$i) {
|
||||
$this->d[$i] -= $h;
|
||||
}
|
||||
$f += $h;
|
||||
// Implicit QL transformation.
|
||||
$p = $this->d[$m];
|
||||
|
@ -277,7 +280,6 @@ class EigenvalueDecomposition {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Nonsymmetric reduction to Hessenberg form.
|
||||
*
|
||||
|
@ -288,7 +290,8 @@ class EigenvalueDecomposition {
|
|||
*
|
||||
* @access private
|
||||
*/
|
||||
private function orthes () {
|
||||
private function orthes()
|
||||
{
|
||||
$low = 0;
|
||||
$high = $this->n-1;
|
||||
|
||||
|
@ -364,13 +367,13 @@ class EigenvalueDecomposition {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Performs complex division.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function cdiv($xr, $xi, $yr, $yi) {
|
||||
private function cdiv($xr, $xi, $yr, $yi)
|
||||
{
|
||||
if (abs($yr) > abs($yi)) {
|
||||
$r = $yi / $yr;
|
||||
$d = $yr + $r * $yi;
|
||||
|
@ -384,7 +387,6 @@ class EigenvalueDecomposition {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Nonsymmetric reduction from Hessenberg to real Schur form.
|
||||
*
|
||||
|
@ -395,7 +397,8 @@ class EigenvalueDecomposition {
|
|||
*
|
||||
* @access private
|
||||
*/
|
||||
private function hqr2 () {
|
||||
private function hqr2()
|
||||
{
|
||||
// Initialize
|
||||
$nn = $this->n;
|
||||
$n = $nn - 1;
|
||||
|
@ -408,7 +411,7 @@ class EigenvalueDecomposition {
|
|||
$norm = 0.0;
|
||||
|
||||
for ($i = 0; $i < $nn; ++$i) {
|
||||
if (($i < $low) OR ($i > $high)) {
|
||||
if (($i < $low) or ($i > $high)) {
|
||||
$this->d[$i] = $this->H[$i][$i];
|
||||
$this->e[$i] = 0.0;
|
||||
}
|
||||
|
@ -477,7 +480,7 @@ class EigenvalueDecomposition {
|
|||
$this->H[$n][$j] = $q * $this->H[$n][$j] - $p * $z;
|
||||
}
|
||||
// Column modification
|
||||
for ($i = 0; $i <= n; ++$i) {
|
||||
for ($i = 0; $i <= $n; ++$i) {
|
||||
$z = $this->H[$i][$n-1];
|
||||
$this->H[$i][$n-1] = $q * $z + $p * $this->H[$i][$n];
|
||||
$this->H[$i][$n] = $q * $this->H[$i][$n] - $p * $z;
|
||||
|
@ -771,7 +774,6 @@ class EigenvalueDecomposition {
|
|||
}
|
||||
} // end hqr2
|
||||
|
||||
|
||||
/**
|
||||
* Constructor: Check for symmetry, then construct the eigenvalue decomposition
|
||||
*
|
||||
|
@ -779,7 +781,8 @@ class EigenvalueDecomposition {
|
|||
* @param A Square matrix
|
||||
* @return Structure to access D and V.
|
||||
*/
|
||||
public function __construct($Arg) {
|
||||
public function __construct($Arg)
|
||||
{
|
||||
$this->A = $Arg->getArray();
|
||||
$this->n = $Arg->getColumnDimension();
|
||||
|
||||
|
@ -806,47 +809,47 @@ class EigenvalueDecomposition {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the eigenvector matrix
|
||||
*
|
||||
* @access public
|
||||
* @return V
|
||||
*/
|
||||
public function getV() {
|
||||
public function getV()
|
||||
{
|
||||
return new Matrix($this->V, $this->n, $this->n);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the real parts of the eigenvalues
|
||||
*
|
||||
* @access public
|
||||
* @return real(diag(D))
|
||||
*/
|
||||
public function getRealEigenvalues() {
|
||||
public function getRealEigenvalues()
|
||||
{
|
||||
return $this->d;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the imaginary parts of the eigenvalues
|
||||
*
|
||||
* @access public
|
||||
* @return imag(diag(D))
|
||||
*/
|
||||
public function getImagEigenvalues() {
|
||||
public function getImagEigenvalues()
|
||||
{
|
||||
return $this->e;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the block diagonal eigenvalue matrix
|
||||
*
|
||||
* @access public
|
||||
* @return D
|
||||
*/
|
||||
public function getD() {
|
||||
public function getD()
|
||||
{
|
||||
for ($i = 0; $i < $this->n; ++$i) {
|
||||
$D[$i] = array_fill(0, $this->n, 0.0);
|
||||
$D[$i][$i] = $this->d[$i];
|
||||
|
@ -858,5 +861,4 @@ class EigenvalueDecomposition {
|
|||
}
|
||||
return new Matrix($D);
|
||||
}
|
||||
|
||||
} // class EigenvalueDecomposition
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* @version 1.1
|
||||
* @license PHP v3.0
|
||||
*/
|
||||
class PHPExcel_Shared_JAMA_LUDecomposition {
|
||||
|
||||
class PHPExcel_Shared_JAMA_LUDecomposition
|
||||
{
|
||||
const MatrixSingularException = "Can only perform operation on singular matrix.";
|
||||
const MatrixSquareException = "Mismatched Row dimension";
|
||||
|
||||
|
@ -53,14 +53,14 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
*/
|
||||
private $piv = array();
|
||||
|
||||
|
||||
/**
|
||||
* LU Decomposition constructor.
|
||||
*
|
||||
* @param $A Rectangular matrix
|
||||
* @return Structure to access L, U and piv.
|
||||
*/
|
||||
public function __construct($A) {
|
||||
public function __construct($A)
|
||||
{
|
||||
if ($A instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
// Use a "left-looking", dot-product, Crout/Doolittle algorithm.
|
||||
$this->LU = $A->getArray();
|
||||
|
@ -119,13 +119,13 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* Get lower triangular factor.
|
||||
*
|
||||
* @return array Lower triangular factor
|
||||
*/
|
||||
public function getL() {
|
||||
public function getL()
|
||||
{
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
if ($i > $j) {
|
||||
|
@ -140,13 +140,13 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
return new PHPExcel_Shared_JAMA_Matrix($L);
|
||||
} // function getL()
|
||||
|
||||
|
||||
/**
|
||||
* Get upper triangular factor.
|
||||
*
|
||||
* @return array Upper triangular factor
|
||||
*/
|
||||
public function getU() {
|
||||
public function getU()
|
||||
{
|
||||
for ($i = 0; $i < $this->n; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
if ($i <= $j) {
|
||||
|
@ -159,33 +159,33 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
return new PHPExcel_Shared_JAMA_Matrix($U);
|
||||
} // function getU()
|
||||
|
||||
|
||||
/**
|
||||
* Return pivot permutation vector.
|
||||
*
|
||||
* @return array Pivot vector
|
||||
*/
|
||||
public function getPivot() {
|
||||
public function getPivot()
|
||||
{
|
||||
return $this->piv;
|
||||
} // function getPivot()
|
||||
|
||||
|
||||
/**
|
||||
* Alias for getPivot
|
||||
*
|
||||
* @see getPivot
|
||||
*/
|
||||
public function getDoublePivot() {
|
||||
public function getDoublePivot()
|
||||
{
|
||||
return $this->getPivot();
|
||||
} // function getDoublePivot()
|
||||
|
||||
|
||||
/**
|
||||
* Is the matrix nonsingular?
|
||||
*
|
||||
* @return true if U, and hence A, is nonsingular.
|
||||
*/
|
||||
public function isNonsingular() {
|
||||
public function isNonsingular()
|
||||
{
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
if ($this->LU[$j][$j] == 0) {
|
||||
return false;
|
||||
|
@ -194,13 +194,13 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
return true;
|
||||
} // function isNonsingular()
|
||||
|
||||
|
||||
/**
|
||||
* Count determinants
|
||||
*
|
||||
* @return array d matrix deterninat
|
||||
*/
|
||||
public function det() {
|
||||
public function det()
|
||||
{
|
||||
if ($this->m == $this->n) {
|
||||
$d = $this->pivsign;
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
|
@ -212,7 +212,6 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
}
|
||||
} // function det()
|
||||
|
||||
|
||||
/**
|
||||
* Solve A*X = B
|
||||
*
|
||||
|
@ -221,7 +220,8 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
* @PHPExcel_Calculation_Exception IllegalArgumentException Matrix row dimensions must agree.
|
||||
* @PHPExcel_Calculation_Exception RuntimeException Matrix is singular.
|
||||
*/
|
||||
public function solve($B) {
|
||||
public function solve($B)
|
||||
{
|
||||
if ($B->getRowDimension() == $this->m) {
|
||||
if ($this->isNonsingular()) {
|
||||
// Copy right hand side with pivoting
|
||||
|
@ -254,5 +254,4 @@ class PHPExcel_Shared_JAMA_LUDecomposition {
|
|||
throw new PHPExcel_Calculation_Exception(self::MatrixSquareException);
|
||||
}
|
||||
} // function solve()
|
||||
|
||||
} // class PHPExcel_Shared_JAMA_LUDecomposition
|
||||
}
|
||||
|
|
|
@ -24,9 +24,8 @@ if (!defined('PHPEXCEL_ROOT')) {
|
|||
* @license PHP v3.0
|
||||
* @see http://math.nist.gov/javanumerics/jama/
|
||||
*/
|
||||
class PHPExcel_Shared_JAMA_Matrix {
|
||||
|
||||
|
||||
class PHPExcel_Shared_JAMA_Matrix
|
||||
{
|
||||
const PolymorphicArgumentException = "Invalid argument pattern for polymorphic function.";
|
||||
const ArgumentTypeException = "Invalid argument type.";
|
||||
const ArgumentBoundsException = "Invalid argument range.";
|
||||
|
@ -57,13 +56,13 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
*/
|
||||
private $n;
|
||||
|
||||
|
||||
/**
|
||||
* Polymorphic constructor
|
||||
*
|
||||
* As PHP has no support for polymorphic constructors, we hack our own sort of polymorphism using func_num_args, func_get_arg, and gettype. In essence, we're just implementing a simple RTTI filter and calling the appropriate constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
@ -114,37 +113,36 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function __construct()
|
||||
|
||||
|
||||
/**
|
||||
* getArray
|
||||
*
|
||||
* @return array Matrix array
|
||||
*/
|
||||
public function getArray() {
|
||||
public function getArray()
|
||||
{
|
||||
return $this->A;
|
||||
} // function getArray()
|
||||
|
||||
|
||||
/**
|
||||
* getRowDimension
|
||||
*
|
||||
* @return int Row dimension
|
||||
*/
|
||||
public function getRowDimension() {
|
||||
public function getRowDimension()
|
||||
{
|
||||
return $this->m;
|
||||
} // function getRowDimension()
|
||||
|
||||
|
||||
/**
|
||||
* getColumnDimension
|
||||
*
|
||||
* @return int Column dimension
|
||||
*/
|
||||
public function getColumnDimension() {
|
||||
public function getColumnDimension()
|
||||
{
|
||||
return $this->n;
|
||||
} // function getColumnDimension()
|
||||
|
||||
|
||||
/**
|
||||
* get
|
||||
*
|
||||
|
@ -153,11 +151,11 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param int $j Column position
|
||||
* @return mixed Element (int/float/double)
|
||||
*/
|
||||
public function get($i = null, $j = null) {
|
||||
public function get($i = null, $j = null)
|
||||
{
|
||||
return $this->A[$i][$j];
|
||||
} // function get()
|
||||
|
||||
|
||||
/**
|
||||
* getMatrix
|
||||
*
|
||||
|
@ -168,7 +166,8 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param int $jF Final column index
|
||||
* @return Matrix Submatrix
|
||||
*/
|
||||
public function getMatrix() {
|
||||
public function getMatrix()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
@ -177,8 +176,16 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
//A($i0...; $j0...)
|
||||
case 'integer,integer':
|
||||
list($i0, $j0) = $args;
|
||||
if ($i0 >= 0) { $m = $this->m - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if ($j0 >= 0) { $n = $this->n - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if ($i0 >= 0) {
|
||||
$m = $this->m - $i0;
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
if ($j0 >= 0) {
|
||||
$n = $this->n - $j0;
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
|
||||
for ($i = $i0; $i < $this->m; ++$i) {
|
||||
for ($j = $j0; $j < $this->n; ++$j) {
|
||||
|
@ -190,8 +197,16 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
//A($i0...$iF; $j0...$jF)
|
||||
case 'integer,integer,integer,integer':
|
||||
list($i0, $iF, $j0, $jF) = $args;
|
||||
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
|
||||
$m = $iF - $i0;
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
|
||||
$n = $jF - $j0;
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($m+1, $n+1);
|
||||
for ($i = $i0; $i <= $iF; ++$i) {
|
||||
for ($j = $j0; $j <= $jF; ++$j) {
|
||||
|
@ -203,8 +218,16 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
//$R = array of row indices; $C = array of column indices
|
||||
case 'array,array':
|
||||
list($RL, $CL) = $args;
|
||||
if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (count($RL) > 0) {
|
||||
$m = count($RL);
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
if (count($CL) > 0) {
|
||||
$n = count($CL);
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
|
||||
for ($i = 0; $i < $m; ++$i) {
|
||||
for ($j = 0; $j < $n; ++$j) {
|
||||
|
@ -216,8 +239,16 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
//$RL = array of row indices; $CL = array of column indices
|
||||
case 'array,array':
|
||||
list($RL, $CL) = $args;
|
||||
if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (count($RL) > 0) {
|
||||
$m = count($RL);
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
if (count($CL) > 0) {
|
||||
$n = count($CL);
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
|
||||
for ($i = 0; $i < $m; ++$i) {
|
||||
for ($j = 0; $j < $n; ++$j) {
|
||||
|
@ -229,8 +260,16 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
//A($i0...$iF); $CL = array of column indices
|
||||
case 'integer,integer,array':
|
||||
list($i0, $iF, $CL) = $args;
|
||||
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
|
||||
$m = $iF - $i0;
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
if (count($CL) > 0) {
|
||||
$n = count($CL);
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
|
||||
for ($i = $i0; $i < $iF; ++$i) {
|
||||
for ($j = 0; $j < $n; ++$j) {
|
||||
|
@ -242,8 +281,16 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
//$RL = array of row indices
|
||||
case 'array,integer,integer':
|
||||
list($RL, $j0, $jF) = $args;
|
||||
if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
|
||||
if (count($RL) > 0) {
|
||||
$m = count($RL);
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
|
||||
$n = $jF - $j0;
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
|
||||
}
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n+1);
|
||||
for ($i = 0; $i < $m; ++$i) {
|
||||
for ($j = $j0; $j <= $jF; ++$j) {
|
||||
|
@ -261,7 +308,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function getMatrix()
|
||||
|
||||
|
||||
/**
|
||||
* checkMatrixDimensions
|
||||
*
|
||||
|
@ -269,7 +315,8 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param Matrix $B Matrix B
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkMatrixDimensions($B = null) {
|
||||
public function checkMatrixDimensions($B = null)
|
||||
{
|
||||
if ($B instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) {
|
||||
return true;
|
||||
|
@ -281,8 +328,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function checkMatrixDimensions()
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* set
|
||||
*
|
||||
|
@ -292,12 +337,12 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $c Int/float/double value
|
||||
* @return mixed Element (int/float/double)
|
||||
*/
|
||||
public function set($i = null, $j = null, $c = null) {
|
||||
public function set($i = null, $j = null, $c = null)
|
||||
{
|
||||
// Optimized set version just has this
|
||||
$this->A[$i][$j] = $c;
|
||||
} // function set()
|
||||
|
||||
|
||||
/**
|
||||
* identity
|
||||
*
|
||||
|
@ -306,11 +351,11 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param int $n Column dimension
|
||||
* @return Matrix Identity matrix
|
||||
*/
|
||||
public function identity($m = null, $n = null) {
|
||||
public function identity($m = null, $n = null)
|
||||
{
|
||||
return $this->diagonal($m, $n, 1);
|
||||
} // function identity()
|
||||
|
||||
|
||||
/**
|
||||
* diagonal
|
||||
*
|
||||
|
@ -320,7 +365,8 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $c Diagonal value
|
||||
* @return Matrix Diagonal matrix
|
||||
*/
|
||||
public function diagonal($m = null, $n = null, $c = 1) {
|
||||
public function diagonal($m = null, $n = null, $c = 1)
|
||||
{
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
|
||||
for ($i = 0; $i < $m; ++$i) {
|
||||
$R->set($i, $i, $c);
|
||||
|
@ -328,7 +374,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
return $R;
|
||||
} // function diagonal()
|
||||
|
||||
|
||||
/**
|
||||
* getMatrixByRow
|
||||
*
|
||||
|
@ -337,7 +382,8 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param int $iF Final row index
|
||||
* @return Matrix Submatrix
|
||||
*/
|
||||
public function getMatrixByRow($i0 = null, $iF = null) {
|
||||
public function getMatrixByRow($i0 = null, $iF = null)
|
||||
{
|
||||
if (is_int($i0)) {
|
||||
if (is_int($iF)) {
|
||||
return $this->getMatrix($i0, 0, $iF + 1, $this->n);
|
||||
|
@ -349,7 +395,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function getMatrixByRow()
|
||||
|
||||
|
||||
/**
|
||||
* getMatrixByCol
|
||||
*
|
||||
|
@ -358,7 +403,8 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param int $iF Final column index
|
||||
* @return Matrix Submatrix
|
||||
*/
|
||||
public function getMatrixByCol($j0 = null, $jF = null) {
|
||||
public function getMatrixByCol($j0 = null, $jF = null)
|
||||
{
|
||||
if (is_int($j0)) {
|
||||
if (is_int($jF)) {
|
||||
return $this->getMatrix(0, $j0, $this->m, $jF + 1);
|
||||
|
@ -370,14 +416,14 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function getMatrixByCol()
|
||||
|
||||
|
||||
/**
|
||||
* transpose
|
||||
*
|
||||
* Tranpose matrix
|
||||
* @return Matrix Transposed matrix
|
||||
*/
|
||||
public function transpose() {
|
||||
public function transpose()
|
||||
{
|
||||
$R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m);
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
|
@ -387,14 +433,14 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
return $R;
|
||||
} // function transpose()
|
||||
|
||||
|
||||
/**
|
||||
* trace
|
||||
*
|
||||
* Sum of diagonal elements
|
||||
* @return float Sum of diagonal elements
|
||||
*/
|
||||
public function trace() {
|
||||
public function trace()
|
||||
{
|
||||
$s = 0;
|
||||
$n = min($this->m, $this->n);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
|
@ -403,17 +449,16 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
return $s;
|
||||
} // function trace()
|
||||
|
||||
|
||||
/**
|
||||
* uminus
|
||||
*
|
||||
* Unary minus matrix -A
|
||||
* @return Matrix Unary minus matrix
|
||||
*/
|
||||
public function uminus() {
|
||||
public function uminus()
|
||||
{
|
||||
} // function uminus()
|
||||
|
||||
|
||||
/**
|
||||
* plus
|
||||
*
|
||||
|
@ -421,14 +466,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Sum
|
||||
*/
|
||||
public function plus() {
|
||||
public function plus()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -449,7 +499,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function plus()
|
||||
|
||||
|
||||
/**
|
||||
* plusEquals
|
||||
*
|
||||
|
@ -457,14 +506,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Sum
|
||||
*/
|
||||
public function plusEquals() {
|
||||
public function plusEquals()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -476,7 +530,7 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
$this->checkMatrixDimensions($M);
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
$validValues = True;
|
||||
$validValues = true;
|
||||
$value = $M->get($i, $j);
|
||||
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
|
||||
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
|
||||
|
@ -499,7 +553,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function plusEquals()
|
||||
|
||||
|
||||
/**
|
||||
* minus
|
||||
*
|
||||
|
@ -507,14 +560,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Sum
|
||||
*/
|
||||
public function minus() {
|
||||
public function minus()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -535,7 +593,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function minus()
|
||||
|
||||
|
||||
/**
|
||||
* minusEquals
|
||||
*
|
||||
|
@ -543,14 +600,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Sum
|
||||
*/
|
||||
public function minusEquals() {
|
||||
public function minusEquals()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -562,7 +624,7 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
$this->checkMatrixDimensions($M);
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
$validValues = True;
|
||||
$validValues = true;
|
||||
$value = $M->get($i, $j);
|
||||
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
|
||||
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
|
||||
|
@ -585,7 +647,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function minusEquals()
|
||||
|
||||
|
||||
/**
|
||||
* arrayTimes
|
||||
*
|
||||
|
@ -594,14 +655,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Matrix Cij
|
||||
*/
|
||||
public function arrayTimes() {
|
||||
public function arrayTimes()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -622,7 +688,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function arrayTimes()
|
||||
|
||||
|
||||
/**
|
||||
* arrayTimesEquals
|
||||
*
|
||||
|
@ -631,14 +696,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Matrix Aij
|
||||
*/
|
||||
public function arrayTimesEquals() {
|
||||
public function arrayTimesEquals()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -650,7 +720,7 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
$this->checkMatrixDimensions($M);
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
$validValues = True;
|
||||
$validValues = true;
|
||||
$value = $M->get($i, $j);
|
||||
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
|
||||
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
|
||||
|
@ -673,7 +743,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function arrayTimesEquals()
|
||||
|
||||
|
||||
/**
|
||||
* arrayRightDivide
|
||||
*
|
||||
|
@ -682,14 +751,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param Matrix $B Matrix B
|
||||
* @return Matrix Division result
|
||||
*/
|
||||
public function arrayRightDivide() {
|
||||
public function arrayRightDivide()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -701,7 +775,7 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
$this->checkMatrixDimensions($M);
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
$validValues = True;
|
||||
$validValues = true;
|
||||
$value = $M->get($i, $j);
|
||||
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
|
||||
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
|
||||
|
@ -738,14 +812,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Matrix Aij
|
||||
*/
|
||||
public function arrayRightDivideEquals() {
|
||||
public function arrayRightDivideEquals()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -775,14 +854,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param Matrix $B Matrix B
|
||||
* @return Matrix Division result
|
||||
*/
|
||||
public function arrayLeftDivide() {
|
||||
public function arrayLeftDivide()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -812,14 +896,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Matrix Aij
|
||||
*/
|
||||
public function arrayLeftDivideEquals() {
|
||||
public function arrayLeftDivideEquals()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -848,14 +937,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $n Matrix/Array/Scalar
|
||||
* @return Matrix Product
|
||||
*/
|
||||
public function times() {
|
||||
public function times()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $B = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$B = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
if ($this->n == $B->m) {
|
||||
$C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n);
|
||||
for ($j = 0; $j < $B->n; ++$j) {
|
||||
|
@ -931,7 +1025,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function times()
|
||||
|
||||
|
||||
/**
|
||||
* power
|
||||
*
|
||||
|
@ -939,14 +1032,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Sum
|
||||
*/
|
||||
public function power() {
|
||||
public function power()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
|
@ -958,7 +1056,7 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
$this->checkMatrixDimensions($M);
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
$validValues = True;
|
||||
$validValues = true;
|
||||
$value = $M->get($i, $j);
|
||||
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
|
||||
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
|
||||
|
@ -981,7 +1079,6 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function power()
|
||||
|
||||
|
||||
/**
|
||||
* concat
|
||||
*
|
||||
|
@ -989,14 +1086,19 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
* @param mixed $B Matrix/Array
|
||||
* @return Matrix Sum
|
||||
*/
|
||||
public function concat() {
|
||||
public function concat()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$args = func_get_args();
|
||||
$match = implode(",", array_map('gettype', $args));
|
||||
|
||||
switch ($match) {
|
||||
case 'object':
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException); }
|
||||
if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
$M = $args[0];
|
||||
} else {
|
||||
throw new PHPExcel_Calculation_Exception(self::ArgumentTypeException);
|
||||
}
|
||||
case 'array':
|
||||
$M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
|
||||
break;
|
||||
|
@ -1016,14 +1118,14 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function concat()
|
||||
|
||||
|
||||
/**
|
||||
* Solve A*X = B.
|
||||
*
|
||||
* @param Matrix $B Right hand side
|
||||
* @return Matrix ... Solution if A is square, least squares solution otherwise
|
||||
*/
|
||||
public function solve($B) {
|
||||
public function solve($B)
|
||||
{
|
||||
if ($this->m == $this->n) {
|
||||
$LU = new PHPExcel_Shared_JAMA_LUDecomposition($this);
|
||||
return $LU->solve($B);
|
||||
|
@ -1033,24 +1135,24 @@ class PHPExcel_Shared_JAMA_Matrix {
|
|||
}
|
||||
} // function solve()
|
||||
|
||||
|
||||
/**
|
||||
* Matrix inverse or pseudoinverse.
|
||||
*
|
||||
* @return Matrix ... Inverse(A) if A is square, pseudoinverse otherwise.
|
||||
*/
|
||||
public function inverse() {
|
||||
public function inverse()
|
||||
{
|
||||
return $this->solve($this->identity($this->m, $this->m));
|
||||
} // function inverse()
|
||||
|
||||
|
||||
/**
|
||||
* det
|
||||
*
|
||||
* Calculate determinant
|
||||
* @return float Determinant
|
||||
*/
|
||||
public function det() {
|
||||
public function det()
|
||||
{
|
||||
$L = new PHPExcel_Shared_JAMA_LUDecomposition($this);
|
||||
return $L->det();
|
||||
} // function det()
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* @license PHP v3.0
|
||||
* @version 1.1
|
||||
*/
|
||||
class PHPExcel_Shared_JAMA_QRDecomposition {
|
||||
|
||||
class PHPExcel_Shared_JAMA_QRDecomposition
|
||||
{
|
||||
const MatrixRankException = "Can only perform operation on full-rank matrix.";
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,8 @@ class PHPExcel_Shared_JAMA_QRDecomposition {
|
|||
* @param matrix $A Rectangular matrix
|
||||
* @return Structure to access R and the Householder vectors and compute Q.
|
||||
*/
|
||||
public function __construct($A) {
|
||||
public function __construct($A)
|
||||
{
|
||||
if ($A instanceof PHPExcel_Shared_JAMA_Matrix) {
|
||||
// Initialize.
|
||||
$this->QR = $A->getArrayCopy();
|
||||
|
@ -98,7 +99,8 @@ class PHPExcel_Shared_JAMA_QRDecomposition {
|
|||
*
|
||||
* @return boolean true if R, and hence A, has full rank, else false.
|
||||
*/
|
||||
public function isFullRank() {
|
||||
public function isFullRank()
|
||||
{
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
if ($this->Rdiag[$j] == 0) {
|
||||
return false;
|
||||
|
@ -107,13 +109,13 @@ class PHPExcel_Shared_JAMA_QRDecomposition {
|
|||
return true;
|
||||
} // function isFullRank()
|
||||
|
||||
|
||||
/**
|
||||
* Return the Householder vectors
|
||||
*
|
||||
* @return Matrix Lower trapezoidal matrix whose columns define the reflections
|
||||
*/
|
||||
public function getH() {
|
||||
public function getH()
|
||||
{
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
if ($i >= $j) {
|
||||
|
@ -126,13 +128,13 @@ class PHPExcel_Shared_JAMA_QRDecomposition {
|
|||
return new PHPExcel_Shared_JAMA_Matrix($H);
|
||||
} // function getH()
|
||||
|
||||
|
||||
/**
|
||||
* Return the upper triangular factor
|
||||
*
|
||||
* @return Matrix upper triangular factor
|
||||
*/
|
||||
public function getR() {
|
||||
public function getR()
|
||||
{
|
||||
for ($i = 0; $i < $this->n; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
if ($i < $j) {
|
||||
|
@ -147,13 +149,13 @@ class PHPExcel_Shared_JAMA_QRDecomposition {
|
|||
return new PHPExcel_Shared_JAMA_Matrix($R);
|
||||
} // function getR()
|
||||
|
||||
|
||||
/**
|
||||
* Generate and return the (economy-sized) orthogonal factor
|
||||
*
|
||||
* @return Matrix orthogonal factor
|
||||
*/
|
||||
public function getQ() {
|
||||
public function getQ()
|
||||
{
|
||||
for ($k = $this->n-1; $k >= 0; --$k) {
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
$Q[$i][$k] = 0.0;
|
||||
|
@ -184,14 +186,14 @@ class PHPExcel_Shared_JAMA_QRDecomposition {
|
|||
return new PHPExcel_Shared_JAMA_Matrix($Q);
|
||||
} // function getQ()
|
||||
|
||||
|
||||
/**
|
||||
* Least squares solution of A*X = B
|
||||
*
|
||||
* @param Matrix $B A Matrix with as many rows as A and any number of columns.
|
||||
* @return Matrix Matrix that minimizes the two norm of Q*R*X-B.
|
||||
*/
|
||||
public function solve($B) {
|
||||
public function solve($B)
|
||||
{
|
||||
if ($B->getRowDimension() == $this->m) {
|
||||
if ($this->isFullRank()) {
|
||||
// Copy right hand side
|
||||
|
@ -230,5 +232,4 @@ class PHPExcel_Shared_JAMA_QRDecomposition {
|
|||
throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MatrixDimensionException);
|
||||
}
|
||||
} // function solve()
|
||||
|
||||
} // PHPExcel_Shared_JAMA_class QRDecomposition
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* @license PHP v3.0
|
||||
* @version 1.1
|
||||
*/
|
||||
class SingularValueDecomposition {
|
||||
|
||||
class SingularValueDecomposition
|
||||
{
|
||||
/**
|
||||
* Internal storage of U.
|
||||
* @var array
|
||||
|
@ -49,7 +49,6 @@ class SingularValueDecomposition {
|
|||
*/
|
||||
private $n;
|
||||
|
||||
|
||||
/**
|
||||
* Construct the singular value decomposition
|
||||
*
|
||||
|
@ -58,8 +57,8 @@ class SingularValueDecomposition {
|
|||
* @param $A Rectangular matrix
|
||||
* @return Structure to access U, S and V.
|
||||
*/
|
||||
public function __construct($Arg) {
|
||||
|
||||
public function __construct($Arg)
|
||||
{
|
||||
// Initialize.
|
||||
$A = $Arg->getArrayCopy();
|
||||
$this->m = $Arg->getRowDimension();
|
||||
|
@ -75,7 +74,6 @@ class SingularValueDecomposition {
|
|||
// Reduce A to bidiagonal form, storing the diagonal elements
|
||||
// in s and the super-diagonal elements in e.
|
||||
for ($k = 0; $k < max($nct, $nrt); ++$k) {
|
||||
|
||||
if ($k < $nct) {
|
||||
// Compute the transformation for the k-th column and
|
||||
// place the k-th diagonal in s[$k].
|
||||
|
@ -113,7 +111,7 @@ class SingularValueDecomposition {
|
|||
}
|
||||
}
|
||||
|
||||
if ($wantu AND ($k < $nct)) {
|
||||
if ($wantu and ($k < $nct)) {
|
||||
// Place the transformation in U for subsequent back
|
||||
// multiplication.
|
||||
for ($i = $k; $i < $this->m; ++$i) {
|
||||
|
@ -139,7 +137,7 @@ class SingularValueDecomposition {
|
|||
$e[$k+1] += 1.0;
|
||||
}
|
||||
$e[$k] = -$e[$k];
|
||||
if (($k+1 < $this->m) AND ($e[$k] != 0.0)) {
|
||||
if (($k+1 < $this->m) and ($e[$k] != 0.0)) {
|
||||
// Apply the transformation.
|
||||
for ($i = $k+1; $i < $this->m; ++$i) {
|
||||
$work[$i] = 0.0;
|
||||
|
@ -217,7 +215,7 @@ class SingularValueDecomposition {
|
|||
// If required, generate V.
|
||||
if ($wantv) {
|
||||
for ($k = $this->n - 1; $k >= 0; --$k) {
|
||||
if (($k < $nrt) AND ($e[$k] != 0.0)) {
|
||||
if (($k < $nrt) and ($e[$k] != 0.0)) {
|
||||
for ($j = $k + 1; $j < $nu; ++$j) {
|
||||
$t = 0;
|
||||
for ($i = $k + 1; $i < $this->n; ++$i) {
|
||||
|
@ -331,9 +329,7 @@ class SingularValueDecomposition {
|
|||
// Perform one qr step.
|
||||
case 3:
|
||||
// Calculate the shift.
|
||||
$scale = max(max(max(max(
|
||||
abs($this->s[$p-1]),abs($this->s[$p-2])),abs($e[$p-2])),
|
||||
abs($this->s[$k])), abs($e[$k]));
|
||||
$scale = max(max(max(max(abs($this->s[$p-1]), abs($this->s[$p-2])), abs($e[$p-2])), abs($this->s[$k])), abs($e[$k]));
|
||||
$sp = $this->s[$p-1] / $scale;
|
||||
$spm1 = $this->s[$p-2] / $scale;
|
||||
$epm1 = $e[$p-2] / $scale;
|
||||
|
@ -408,14 +404,14 @@ class SingularValueDecomposition {
|
|||
$t = $this->s[$k];
|
||||
$this->s[$k] = $this->s[$k+1];
|
||||
$this->s[$k+1] = $t;
|
||||
if ($wantv AND ($k < $this->n - 1)) {
|
||||
if ($wantv and ($k < $this->n - 1)) {
|
||||
for ($i = 0; $i < $this->n; ++$i) {
|
||||
$t = $this->V[$i][$k+1];
|
||||
$this->V[$i][$k+1] = $this->V[$i][$k];
|
||||
$this->V[$i][$k] = $t;
|
||||
}
|
||||
}
|
||||
if ($wantu AND ($k < $this->m-1)) {
|
||||
if ($wantu and ($k < $this->m-1)) {
|
||||
for ($i = 0; $i < $this->m; ++$i) {
|
||||
$t = $this->U[$i][$k+1];
|
||||
$this->U[$i][$k+1] = $this->U[$i][$k];
|
||||
|
@ -439,7 +435,8 @@ class SingularValueDecomposition {
|
|||
* @access public
|
||||
* @return U
|
||||
*/
|
||||
public function getU() {
|
||||
public function getU()
|
||||
{
|
||||
return new Matrix($this->U, $this->m, min($this->m + 1, $this->n));
|
||||
}
|
||||
|
||||
|
@ -450,7 +447,8 @@ class SingularValueDecomposition {
|
|||
* @access public
|
||||
* @return V
|
||||
*/
|
||||
public function getV() {
|
||||
public function getV()
|
||||
{
|
||||
return new Matrix($this->V);
|
||||
}
|
||||
|
||||
|
@ -461,7 +459,8 @@ class SingularValueDecomposition {
|
|||
* @access public
|
||||
* @return diagonal of S.
|
||||
*/
|
||||
public function getSingularValues() {
|
||||
public function getSingularValues()
|
||||
{
|
||||
return $this->s;
|
||||
}
|
||||
|
||||
|
@ -472,7 +471,8 @@ class SingularValueDecomposition {
|
|||
* @access public
|
||||
* @return S
|
||||
*/
|
||||
public function getS() {
|
||||
public function getS()
|
||||
{
|
||||
for ($i = 0; $i < $this->n; ++$i) {
|
||||
for ($j = 0; $j < $this->n; ++$j) {
|
||||
$S[$i][$j] = 0.0;
|
||||
|
@ -489,7 +489,8 @@ class SingularValueDecomposition {
|
|||
* @access public
|
||||
* @return max(S)
|
||||
*/
|
||||
public function norm2() {
|
||||
public function norm2()
|
||||
{
|
||||
return $this->s[0];
|
||||
}
|
||||
|
||||
|
@ -500,7 +501,8 @@ class SingularValueDecomposition {
|
|||
* @access public
|
||||
* @return max(S)/min(S)
|
||||
*/
|
||||
public function cond() {
|
||||
public function cond()
|
||||
{
|
||||
return $this->s[0] / $this->s[min($this->m, $this->n) - 1];
|
||||
}
|
||||
|
||||
|
@ -511,7 +513,8 @@ class SingularValueDecomposition {
|
|||
* @access public
|
||||
* @return Number of nonnegligible singular values.
|
||||
*/
|
||||
public function rank() {
|
||||
public function rank()
|
||||
{
|
||||
$eps = pow(2.0, -52.0);
|
||||
$tol = max($this->m, $this->n) * $this->s[0] * $eps;
|
||||
$r = 0;
|
||||
|
@ -522,5 +525,4 @@ class SingularValueDecomposition {
|
|||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
} // class SingularValueDecomposition
|
||||
}
|
||||
|
|
|
@ -67,7 +67,8 @@ $error['EN'][RowLengthException] = "All rows must have the same length.";
|
|||
* Custom error handler
|
||||
* @param int $num Error number
|
||||
*/
|
||||
function JAMAError($errorNumber = null) {
|
||||
function JAMAError($errorNumber = null)
|
||||
{
|
||||
global $error;
|
||||
|
||||
if (isset($errorNumber)) {
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
*
|
||||
* r = sqrt(a^2 + b^2) without under/overflow.
|
||||
*/
|
||||
function hypo($a, $b) {
|
||||
function hypo($a, $b)
|
||||
{
|
||||
if (abs($a) > abs($b)) {
|
||||
$r = $b / $a;
|
||||
$r = abs($a) * sqrt(1 + $r * $r);
|
||||
|
|
|
@ -73,8 +73,9 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
|||
if (is_resource($filename)) {
|
||||
$this->_FILEH_ = $filename;
|
||||
} elseif ($filename == '-' || $filename == '') {
|
||||
if ($this->_tmp_dir === null)
|
||||
if ($this->_tmp_dir === null) {
|
||||
$this->_tmp_dir = PHPExcel_Shared_File::sys_get_temp_dir();
|
||||
}
|
||||
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
|
||||
$this->_FILEH_ = fopen($this->_tmp_filename, "w+b");
|
||||
if ($this->_FILEH_ == false) {
|
||||
|
@ -199,7 +200,8 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
|||
}
|
||||
|
||||
// Save Header
|
||||
fwrite($FILE,
|
||||
fwrite(
|
||||
$FILE,
|
||||
"\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"
|
||||
. "\x00\x00\x00\x00"
|
||||
. "\x00\x00\x00\x00"
|
||||
|
@ -222,7 +224,8 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
|||
);
|
||||
// Extra BDList Start, Count
|
||||
if ($iBdCnt < $i1stBdL) {
|
||||
fwrite($FILE,
|
||||
fwrite(
|
||||
$FILE,
|
||||
pack("V", -2) // Extra BDList Start
|
||||
. pack("V", 0)// Extra BDList Count
|
||||
);
|
||||
|
@ -258,9 +261,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
|
|||
for ($i = 0; $i < $iCount; ++$i) {
|
||||
if ($raList[$i]->Type != PHPExcel_Shared_OLE::OLE_PPS_TYPE_DIR) {
|
||||
$raList[$i]->Size = $raList[$i]->_DataLen();
|
||||
if (($raList[$i]->Size >= PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) ||
|
||||
(($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data)))
|
||||
{
|
||||
if (($raList[$i]->Size >= PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) {
|
||||
// Write Data
|
||||
//if (isset($raList[$i]->_PPS_FILE)) {
|
||||
// $iLen = 0;
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
defined('IDENTIFIER_OLE') ||
|
||||
define('IDENTIFIER_OLE', pack('CCCCCCCC', 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1));
|
||||
|
||||
class PHPExcel_Shared_OLERead {
|
||||
class PHPExcel_Shared_OLERead
|
||||
{
|
||||
private $data = '';
|
||||
|
||||
// OLE identifier
|
||||
|
|
|
@ -3167,7 +3167,6 @@ class PclZip
|
|||
|
||||
// ----- Look for PCLZIP_OPT_STOP_ON_ERROR
|
||||
if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) {
|
||||
|
||||
$this->privSwapBackMagicQuotes();
|
||||
|
||||
PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, "Filename '".$v_header['stored_filename']."' is compressed by an unsupported compression method (".$v_header['compression'].") ");
|
||||
|
@ -3249,9 +3248,8 @@ class PclZip
|
|||
if ($v_result1 == 2) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} elseif ((isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {
|
||||
// ----- Look for extraction in standard output
|
||||
elseif ((isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {
|
||||
// ----- Extracting the file in standard output
|
||||
$v_result1 = $this->privExtractFileInOutput($v_header, $p_options);
|
||||
if ($v_result1 < 1) {
|
||||
|
@ -3410,7 +3408,6 @@ class PclZip
|
|||
if (file_exists($p_entry['filename'])) {
|
||||
// ----- Look if file is a directory
|
||||
if (is_dir($p_entry['filename'])) {
|
||||
|
||||
// ----- Change the file status
|
||||
$p_entry['status'] = "already_a_directory";
|
||||
|
||||
|
@ -3454,16 +3451,13 @@ class PclZip
|
|||
// ----- Check the directory availability and create it if necessary
|
||||
if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) {
|
||||
$v_dir_to_check = $p_entry['filename'];
|
||||
}
|
||||
else if (!strstr($p_entry['filename'], "/")) {
|
||||
} elseif (!strstr($p_entry['filename'], "/")) {
|
||||
$v_dir_to_check = "";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$v_dir_to_check = dirname($p_entry['filename']);
|
||||
}
|
||||
|
||||
if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
|
||||
|
||||
// ----- Change the file status
|
||||
$p_entry['status'] = "path_creation_fail";
|
||||
|
||||
|
@ -3530,7 +3524,6 @@ class PclZip
|
|||
$v_file_content = @gzinflate($v_buffer);
|
||||
unset($v_buffer);
|
||||
if ($v_file_content === false) {
|
||||
|
||||
// ----- Change the file status
|
||||
// TBC
|
||||
$p_entry['status'] = "error";
|
||||
|
@ -3540,7 +3533,6 @@ class PclZip
|
|||
|
||||
// ----- Opening destination file
|
||||
if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
|
||||
|
||||
// ----- Change the file status
|
||||
$p_entry['status'] = "write_error";
|
||||
|
||||
|
@ -3723,7 +3715,6 @@ class PclZip
|
|||
if (!(($p_entry['external']&0x00000010)==0x00000010)) {
|
||||
// ----- Look for not compressed file
|
||||
if ($p_entry['compressed_size'] == $p_entry['size']) {
|
||||
|
||||
// ----- Read the file in a buffer (one shot)
|
||||
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
|
||||
|
||||
|
@ -3731,7 +3722,6 @@ class PclZip
|
|||
echo $v_buffer;
|
||||
unset($v_buffer);
|
||||
} else {
|
||||
|
||||
// ----- Read the compressed file in a buffer (one shot)
|
||||
$v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
|
||||
|
||||
|
@ -3830,11 +3820,9 @@ class PclZip
|
|||
// ----- Look for not compressed file
|
||||
// if ($p_entry['compressed_size'] == $p_entry['size'])
|
||||
if ($p_entry['compression'] == 0) {
|
||||
|
||||
// ----- Reading the file
|
||||
$p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
|
||||
} else {
|
||||
|
||||
// ----- Reading the file
|
||||
$v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
|
||||
|
||||
|
@ -4037,8 +4025,7 @@ class PclZip
|
|||
// ----- Get comment
|
||||
if ($p_header['comment_len'] != 0) {
|
||||
$p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$p_header['comment'] = '';
|
||||
}
|
||||
|
||||
|
@ -4171,8 +4158,9 @@ class PclZip
|
|||
// ----- Go back to the maximum possible size of the Central Dir End Record
|
||||
if (!$v_found) {
|
||||
$v_maximum_size = 65557; // 0xFFFF + 22;
|
||||
if ($v_maximum_size > $v_size)
|
||||
if ($v_maximum_size > $v_size) {
|
||||
$v_maximum_size = $v_size;
|
||||
}
|
||||
@fseek($this->zip_fd, $v_size-$v_maximum_size);
|
||||
if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) {
|
||||
// ----- Error log
|
||||
|
@ -4196,8 +4184,7 @@ class PclZip
|
|||
$v_bytes = (($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
|
||||
|
||||
// ----- Compare the bytes
|
||||
if ($v_bytes == 0x504b0506)
|
||||
{
|
||||
if ($v_bytes == 0x504b0506) {
|
||||
$v_pos++;
|
||||
break;
|
||||
}
|
||||
|
@ -4342,27 +4329,13 @@ class PclZip
|
|||
} elseif ((($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
|
||||
$v_found = true;
|
||||
}
|
||||
}
|
||||
} elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
|
||||
// ----- Look for a filename
|
||||
elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
|
||||
$v_found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----- Look for extract by ereg rule
|
||||
// ereg() is deprecated with PHP 5.3
|
||||
/*
|
||||
else if ( (isset($p_options[PCLZIP_OPT_BY_EREG]))
|
||||
&& ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
|
||||
|
||||
if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
|
||||
$v_found = true;
|
||||
}
|
||||
}
|
||||
*/
|
||||
else if ((isset($p_options[PCLZIP_OPT_BY_PREG]))
|
||||
} elseif ((isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
|
||||
// ----- Look for extract by preg rule
|
||||
&& ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
|
||||
if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
|
||||
$v_found = true;
|
||||
}
|
||||
|
@ -4376,7 +4349,6 @@ class PclZip
|
|||
if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
|
||||
$j_start = $j+1;
|
||||
}
|
||||
|
||||
if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
|
||||
break;
|
||||
}
|
||||
|
@ -4608,7 +4580,6 @@ class PclZip
|
|||
|
||||
// ----- Look if the archive_to_add exists
|
||||
if (!is_file($p_archive_to_add->zipname)) {
|
||||
|
||||
// ----- Nothing to merge, so merge is a success
|
||||
$v_result = 1;
|
||||
|
||||
|
@ -4618,7 +4589,6 @@ class PclZip
|
|||
|
||||
// ----- Look if the archive exists
|
||||
if (!is_file($this->zipname)) {
|
||||
|
||||
// ----- Do a duplicate
|
||||
$v_result = $this->privDuplicate($p_archive_to_add->zipname);
|
||||
|
||||
|
@ -4781,7 +4751,6 @@ class PclZip
|
|||
|
||||
// ----- Look if the $p_archive_filename exists
|
||||
if (!is_file($p_archive_filename)) {
|
||||
|
||||
// ----- Nothing to duplicate, so duplicate is a success.
|
||||
$v_result = 1;
|
||||
|
||||
|
@ -4970,8 +4939,7 @@ function PclZipUtilPathReduction($p_dir)
|
|||
// ----- Look for item to skip
|
||||
if ($v_skip > 0) {
|
||||
$v_skip--;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
|
||||
}
|
||||
}
|
||||
|
@ -5051,8 +5019,12 @@ function PclZipUtilPathInclusion($p_dir, $p_path)
|
|||
// ----- Look if everything seems to be the same
|
||||
if ($v_result) {
|
||||
// ----- Skip all the empty items
|
||||
while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;
|
||||
while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;
|
||||
while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) {
|
||||
$j++;
|
||||
}
|
||||
while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
|
||||
// ----- There are exactly the same
|
||||
|
@ -5160,7 +5132,6 @@ function PclZipUtilRename($p_src, $p_dest)
|
|||
// --------------------------------------------------------------------------------
|
||||
function PclZipUtilOptionText($p_option)
|
||||
{
|
||||
|
||||
$v_list = get_defined_constants();
|
||||
for (reset($v_list); $v_key = key($v_list); next($v_list)) {
|
||||
$v_prefix = substr($v_key, 0, 10);
|
||||
|
@ -5200,4 +5171,3 @@ function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter = true)
|
|||
}
|
||||
return $p_path;
|
||||
}
|
||||
// --------------------------------------------------------------------------------
|
|
@ -131,7 +131,7 @@ class PHPExcel_Shared_ZipStreamWrapper
|
|||
* @param int $count maximum number of bytes to read
|
||||
* @return string
|
||||
*/
|
||||
function stream_read($count)
|
||||
public function stream_read($count)
|
||||
{
|
||||
$ret = substr($this->_data, $this->_position, $count);
|
||||
$this->_position += strlen($ret);
|
||||
|
|
|
@ -138,7 +138,7 @@ class PHPExcel_Exponential_Best_Fit extends PHPExcel_Best_Fit
|
|||
* @param float[] $xValues The set of X-values for this regression
|
||||
* @param boolean $const
|
||||
*/
|
||||
function __construct($yValues, $xValues = array(), $const = true)
|
||||
public function __construct($yValues, $xValues = array(), $const = true)
|
||||
{
|
||||
if (parent::__construct($yValues, $xValues) !== false) {
|
||||
$this->_exponential_regression($yValues, $xValues, $const);
|
||||
|
|
|
@ -100,7 +100,7 @@ class PHPExcel_Linear_Best_Fit extends PHPExcel_Best_Fit
|
|||
* @param float[] $xValues The set of X-values for this regression
|
||||
* @param boolean $const
|
||||
*/
|
||||
function __construct($yValues, $xValues = array(), $const = true)
|
||||
public function __construct($yValues, $xValues = array(), $const = true)
|
||||
{
|
||||
if (parent::__construct($yValues, $xValues) !== false) {
|
||||
$this->_linear_regression($yValues, $xValues, $const);
|
||||
|
|
|
@ -108,7 +108,7 @@ class PHPExcel_Logarithmic_Best_Fit extends PHPExcel_Best_Fit
|
|||
* @param float[] $xValues The set of X-values for this regression
|
||||
* @param boolean $const
|
||||
*/
|
||||
function __construct($yValues, $xValues = array(), $const = true)
|
||||
public function __construct($yValues, $xValues = array(), $const = true)
|
||||
{
|
||||
if (parent::__construct($yValues, $xValues) !== false) {
|
||||
$this->_logarithmic_regression($yValues, $xValues, $const);
|
||||
|
|
|
@ -213,7 +213,7 @@ class PHPExcel_Polynomial_Best_Fit extends PHPExcel_Best_Fit
|
|||
* @param float[] $xValues The set of X-values for this regression
|
||||
* @param boolean $const
|
||||
*/
|
||||
function __construct($order, $yValues, $xValues = array(), $const = true)
|
||||
public function __construct($order, $yValues, $xValues = array(), $const = true)
|
||||
{
|
||||
if (parent::__construct($yValues, $xValues) !== false) {
|
||||
if ($order < $this->_valueCount) {
|
||||
|
|
|
@ -138,7 +138,7 @@ class PHPExcel_Power_Best_Fit extends PHPExcel_Best_Fit
|
|||
* @param float[] $xValues The set of X-values for this regression
|
||||
* @param boolean $const
|
||||
*/
|
||||
function __construct($yValues, $xValues = array(), $const = true)
|
||||
public function __construct($yValues, $xValues = array(), $const = true)
|
||||
{
|
||||
if (parent::__construct($yValues, $xValues) !== false) {
|
||||
$this->_power_regression($yValues, $xValues, $const);
|
||||
|
|
|
@ -153,4 +153,4 @@ class trendClass
|
|||
return false;
|
||||
}
|
||||
} // function calculate()
|
||||
} // class trendClass
|
||||
}
|
||||
|
|
|
@ -391,7 +391,7 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable
|
|||
* Code to execute when this worksheet is unset()
|
||||
*
|
||||
*/
|
||||
function __destruct()
|
||||
public function __destruct()
|
||||
{
|
||||
PHPExcel_Calculation::getInstance($this->_parent)->clearCalculationCacheForWorksheet($this->_title);
|
||||
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
class PHPExcel_Worksheet_ColumnDimension
|
||||
class PHPExcel_Worksheet_ColumnDimension extends PHPExcel_Worksheet_Dimension
|
||||
{
|
||||
/**
|
||||
* Column index
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_columnIndex;
|
||||
private $columnIndex;
|
||||
|
||||
/**
|
||||
* Column width
|
||||
|
@ -41,42 +41,14 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
*
|
||||
* @var double
|
||||
*/
|
||||
private $_width = -1;
|
||||
private $width = -1;
|
||||
|
||||
/**
|
||||
* Auto size?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
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;
|
||||
private $autoSize = false;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_ColumnDimension
|
||||
|
@ -86,10 +58,10 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
public function __construct($pIndex = 'A')
|
||||
{
|
||||
// Initialise values
|
||||
$this->_columnIndex = $pIndex;
|
||||
$this->columnIndex = $pIndex;
|
||||
|
||||
// set default index to cellXf
|
||||
$this->_xfIndex = 0;
|
||||
// set dimension as unformatted by default
|
||||
parent::__construct(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,7 +71,7 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
*/
|
||||
public function getColumnIndex()
|
||||
{
|
||||
return $this->_columnIndex;
|
||||
return $this->columnIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,7 +82,7 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
*/
|
||||
public function setColumnIndex($pValue)
|
||||
{
|
||||
$this->_columnIndex = $pValue;
|
||||
$this->columnIndex = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -121,7 +93,7 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
*/
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->_width;
|
||||
return $this->width;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,7 +104,7 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
*/
|
||||
public function setWidth($pValue = -1)
|
||||
{
|
||||
$this->_width = $pValue;
|
||||
$this->width = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -143,7 +115,7 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
*/
|
||||
public function getAutoSize()
|
||||
{
|
||||
return $this->_autoSize;
|
||||
return $this->autoSize;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,117 +126,7 @@ class PHPExcel_Worksheet_ColumnDimension
|
|||
*/
|
||||
public function setAutoSize($pValue = false)
|
||||
{
|
||||
$this->_autoSize = $pValue;
|
||||
$this->autoSize = $pValue;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -166,7 +166,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function isProtectionEnabled()
|
||||
public function isProtectionEnabled()
|
||||
{
|
||||
return $this->_sheet ||
|
||||
$this->_objects ||
|
||||
|
@ -191,7 +191,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getSheet()
|
||||
public function getSheet()
|
||||
{
|
||||
return $this->_sheet;
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setSheet($pValue = false)
|
||||
public function setSheet($pValue = false)
|
||||
{
|
||||
$this->_sheet = $pValue;
|
||||
return $this;
|
||||
|
@ -213,7 +213,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getObjects()
|
||||
public function getObjects()
|
||||
{
|
||||
return $this->_objects;
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setObjects($pValue = false)
|
||||
public function setObjects($pValue = false)
|
||||
{
|
||||
$this->_objects = $pValue;
|
||||
return $this;
|
||||
|
@ -235,7 +235,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getScenarios()
|
||||
public function getScenarios()
|
||||
{
|
||||
return $this->_scenarios;
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setScenarios($pValue = false)
|
||||
public function setScenarios($pValue = false)
|
||||
{
|
||||
$this->_scenarios = $pValue;
|
||||
return $this;
|
||||
|
@ -257,7 +257,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getFormatCells()
|
||||
public function getFormatCells()
|
||||
{
|
||||
return $this->_formatCells;
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setFormatCells($pValue = false)
|
||||
public function setFormatCells($pValue = false)
|
||||
{
|
||||
$this->_formatCells = $pValue;
|
||||
return $this;
|
||||
|
@ -279,7 +279,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getFormatColumns()
|
||||
public function getFormatColumns()
|
||||
{
|
||||
return $this->_formatColumns;
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setFormatColumns($pValue = false)
|
||||
public function setFormatColumns($pValue = false)
|
||||
{
|
||||
$this->_formatColumns = $pValue;
|
||||
return $this;
|
||||
|
@ -301,7 +301,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getFormatRows()
|
||||
public function getFormatRows()
|
||||
{
|
||||
return $this->_formatRows;
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setFormatRows($pValue = false)
|
||||
public function setFormatRows($pValue = false)
|
||||
{
|
||||
$this->_formatRows = $pValue;
|
||||
return $this;
|
||||
|
@ -323,7 +323,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getInsertColumns()
|
||||
public function getInsertColumns()
|
||||
{
|
||||
return $this->_insertColumns;
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setInsertColumns($pValue = false)
|
||||
public function setInsertColumns($pValue = false)
|
||||
{
|
||||
$this->_insertColumns = $pValue;
|
||||
return $this;
|
||||
|
@ -345,7 +345,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getInsertRows()
|
||||
public function getInsertRows()
|
||||
{
|
||||
return $this->_insertRows;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setInsertRows($pValue = false)
|
||||
public function setInsertRows($pValue = false)
|
||||
{
|
||||
$this->_insertRows = $pValue;
|
||||
return $this;
|
||||
|
@ -367,7 +367,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getInsertHyperlinks()
|
||||
public function getInsertHyperlinks()
|
||||
{
|
||||
return $this->_insertHyperlinks;
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setInsertHyperlinks($pValue = false)
|
||||
public function setInsertHyperlinks($pValue = false)
|
||||
{
|
||||
$this->_insertHyperlinks = $pValue;
|
||||
return $this;
|
||||
|
@ -389,7 +389,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getDeleteColumns()
|
||||
public function getDeleteColumns()
|
||||
{
|
||||
return $this->_deleteColumns;
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setDeleteColumns($pValue = false)
|
||||
public function setDeleteColumns($pValue = false)
|
||||
{
|
||||
$this->_deleteColumns = $pValue;
|
||||
return $this;
|
||||
|
@ -411,7 +411,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getDeleteRows()
|
||||
public function getDeleteRows()
|
||||
{
|
||||
return $this->_deleteRows;
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setDeleteRows($pValue = false)
|
||||
public function setDeleteRows($pValue = false)
|
||||
{
|
||||
$this->_deleteRows = $pValue;
|
||||
return $this;
|
||||
|
@ -433,7 +433,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getSelectLockedCells()
|
||||
public function getSelectLockedCells()
|
||||
{
|
||||
return $this->_selectLockedCells;
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setSelectLockedCells($pValue = false)
|
||||
public function setSelectLockedCells($pValue = false)
|
||||
{
|
||||
$this->_selectLockedCells = $pValue;
|
||||
return $this;
|
||||
|
@ -455,7 +455,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getSort()
|
||||
public function getSort()
|
||||
{
|
||||
return $this->_sort;
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setSort($pValue = false)
|
||||
public function setSort($pValue = false)
|
||||
{
|
||||
$this->_sort = $pValue;
|
||||
return $this;
|
||||
|
@ -477,7 +477,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getAutoFilter()
|
||||
public function getAutoFilter()
|
||||
{
|
||||
return $this->_autoFilter;
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setAutoFilter($pValue = false)
|
||||
public function setAutoFilter($pValue = false)
|
||||
{
|
||||
$this->_autoFilter = $pValue;
|
||||
return $this;
|
||||
|
@ -499,7 +499,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getPivotTables()
|
||||
public function getPivotTables()
|
||||
{
|
||||
return $this->_pivotTables;
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setPivotTables($pValue = false)
|
||||
public function setPivotTables($pValue = false)
|
||||
{
|
||||
$this->_pivotTables = $pValue;
|
||||
return $this;
|
||||
|
@ -521,7 +521,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function getSelectUnlockedCells()
|
||||
public function getSelectUnlockedCells()
|
||||
{
|
||||
return $this->_selectUnlockedCells;
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pValue
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setSelectUnlockedCells($pValue = false)
|
||||
public function setSelectUnlockedCells($pValue = false)
|
||||
{
|
||||
$this->_selectUnlockedCells = $pValue;
|
||||
return $this;
|
||||
|
@ -543,7 +543,7 @@ class PHPExcel_Worksheet_Protection
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
function getPassword()
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->_password;
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ class PHPExcel_Worksheet_Protection
|
|||
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
|
||||
* @return PHPExcel_Worksheet_Protection
|
||||
*/
|
||||
function setPassword($pValue = '', $pAlreadyHashed = false)
|
||||
public function setPassword($pValue = '', $pAlreadyHashed = false)
|
||||
{
|
||||
if (!$pAlreadyHashed) {
|
||||
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version ##VERSION##, ##DATE##
|
||||
*/
|
||||
class PHPExcel_Worksheet_RowDimension
|
||||
class PHPExcel_Worksheet_RowDimension extends PHPExcel_Worksheet_Dimension
|
||||
{
|
||||
/**
|
||||
* Row index
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_rowIndex;
|
||||
private $rowIndex;
|
||||
|
||||
/**
|
||||
* Row height (in pt)
|
||||
|
@ -41,42 +41,14 @@ class PHPExcel_Worksheet_RowDimension
|
|||
*
|
||||
* @var double
|
||||
*/
|
||||
private $_rowHeight = -1;
|
||||
private $height = -1;
|
||||
|
||||
/**
|
||||
* ZeroHeight for Row?
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
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;
|
||||
private $zeroHeight = false;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_RowDimension
|
||||
|
@ -86,10 +58,10 @@ class PHPExcel_Worksheet_RowDimension
|
|||
public function __construct($pIndex = 0)
|
||||
{
|
||||
// Initialise values
|
||||
$this->_rowIndex = $pIndex;
|
||||
$this->rowIndex = $pIndex;
|
||||
|
||||
// set row dimension as unformatted by default
|
||||
$this->_xfIndex = null;
|
||||
// set dimension as unformatted by default
|
||||
parent::__construct(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,7 +71,7 @@ class PHPExcel_Worksheet_RowDimension
|
|||
*/
|
||||
public function getRowIndex()
|
||||
{
|
||||
return $this->_rowIndex;
|
||||
return $this->rowIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,7 +82,7 @@ class PHPExcel_Worksheet_RowDimension
|
|||
*/
|
||||
public function setRowIndex($pValue)
|
||||
{
|
||||
$this->_rowIndex = $pValue;
|
||||
$this->rowIndex = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -121,7 +93,7 @@ class PHPExcel_Worksheet_RowDimension
|
|||
*/
|
||||
public function getRowHeight()
|
||||
{
|
||||
return $this->_rowHeight;
|
||||
return $this->height;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -132,7 +104,7 @@ class PHPExcel_Worksheet_RowDimension
|
|||
*/
|
||||
public function setRowHeight($pValue = -1)
|
||||
{
|
||||
$this->_rowHeight = $pValue;
|
||||
$this->height = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -143,7 +115,7 @@ class PHPExcel_Worksheet_RowDimension
|
|||
*/
|
||||
public function getZeroHeight()
|
||||
{
|
||||
return $this->_zeroHeight;
|
||||
return $this->zeroHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,117 +126,7 @@ class PHPExcel_Worksheet_RowDimension
|
|||
*/
|
||||
public function setZeroHeight($pValue = false)
|
||||
{
|
||||
$this->_zeroHeight = $pValue;
|
||||
$this->zeroHeight = $pValue;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
* PHPExcel_Worksheet_SheetView
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
|
@ -24,15 +25,6 @@
|
|||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @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
|
||||
{
|
||||
|
||||
|
@ -54,7 +46,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_zoomScale = 100;
|
||||
private $zoomScale = 100;
|
||||
|
||||
/**
|
||||
* ZoomScaleNormal
|
||||
|
@ -63,7 +55,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_zoomScaleNormal = 100;
|
||||
private $zoomScaleNormal = 100;
|
||||
|
||||
/**
|
||||
* View
|
||||
|
@ -72,7 +64,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_sheetviewType = self::SHEETVIEW_NORMAL;
|
||||
private $sheetviewType = self::SHEETVIEW_NORMAL;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Worksheet_SheetView
|
||||
|
@ -88,7 +80,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
*/
|
||||
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,
|
||||
// but it is apparently still able to handle any scale >= 1
|
||||
if (($pValue >= 1) || is_null($pValue)) {
|
||||
$this->_zoomScale = $pValue;
|
||||
$this->zoomScale = $pValue;
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
|
||||
}
|
||||
|
@ -119,7 +111,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
*/
|
||||
public function getZoomScaleNormal()
|
||||
{
|
||||
return $this->_zoomScaleNormal;
|
||||
return $this->zoomScaleNormal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -134,7 +126,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
public function setZoomScaleNormal($pValue = 100)
|
||||
{
|
||||
if (($pValue >= 1) || is_null($pValue)) {
|
||||
$this->_zoomScaleNormal = $pValue;
|
||||
$this->zoomScaleNormal = $pValue;
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
|
||||
}
|
||||
|
@ -148,7 +140,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
*/
|
||||
public function getView()
|
||||
{
|
||||
return $this->_sheetviewType;
|
||||
return $this->sheetviewType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,7 +162,7 @@ class PHPExcel_Worksheet_SheetView
|
|||
$pValue = self::SHEETVIEW_NORMAL;
|
||||
}
|
||||
if (in_array($pValue, self::$_sheetViewTypes)) {
|
||||
$this->_sheetviewType = $pValue;
|
||||
$this->sheetviewType = $pValue;
|
||||
} else {
|
||||
throw new PHPExcel_Exception("Invalid sheetview layout type.");
|
||||
}
|
||||
|
|
|
@ -32,49 +32,49 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*
|
||||
* @var PHPExcel
|
||||
*/
|
||||
private $_phpExcel;
|
||||
private $phpExcel;
|
||||
|
||||
/**
|
||||
* Delimiter
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_delimiter = ',';
|
||||
private $delimiter = ',';
|
||||
|
||||
/**
|
||||
* Enclosure
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_enclosure = '"';
|
||||
private $enclosure = '"';
|
||||
|
||||
/**
|
||||
* Line ending
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_lineEnding = PHP_EOL;
|
||||
private $lineEnding = PHP_EOL;
|
||||
|
||||
/**
|
||||
* Sheet index to write
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_sheetIndex = 0;
|
||||
private $sheetIndex = 0;
|
||||
|
||||
/**
|
||||
* Whether to write a BOM (for UTF8).
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_useBOM = false;
|
||||
private $useBOM = false;
|
||||
|
||||
/**
|
||||
* Whether to write a fully Excel compatible CSV file.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_excelCompatibility = false;
|
||||
private $excelCompatibility = false;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Writer_CSV
|
||||
|
@ -83,7 +83,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function __construct(PHPExcel $phpExcel)
|
||||
{
|
||||
$this->_phpExcel = $phpExcel;
|
||||
$this->phpExcel = $phpExcel;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,10 +95,10 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
public function save($pFilename = null)
|
||||
{
|
||||
// Fetch sheet
|
||||
$sheet = $this->_phpExcel->getSheet($this->_sheetIndex);
|
||||
$sheet = $this->phpExcel->getSheet($this->sheetIndex);
|
||||
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->getWriteDebugLog();
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
|
||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
||||
$saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||
|
||||
|
@ -108,13 +108,13 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing.");
|
||||
}
|
||||
|
||||
if ($this->_excelCompatibility) {
|
||||
if ($this->excelCompatibility) {
|
||||
fwrite($fileHandle, "\xEF\xBB\xBF"); // Enforce UTF-8 BOM Header
|
||||
$this->setEnclosure('"'); // Set enclosure to "
|
||||
$this->setDelimiter(";"); // Set delimiter to a semi-colon
|
||||
$this->setLineEnding("\r\n");
|
||||
fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->_lineEnding);
|
||||
} elseif ($this->_useBOM) {
|
||||
fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->lineEnding);
|
||||
} elseif ($this->useBOM) {
|
||||
// Write the UTF-8 BOM code if required
|
||||
fwrite($fileHandle, "\xEF\xBB\xBF");
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
fclose($fileHandle);
|
||||
|
||||
PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,7 +145,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function getDelimiter()
|
||||
{
|
||||
return $this->_delimiter;
|
||||
return $this->delimiter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,7 +156,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function setDelimiter($pValue = ',')
|
||||
{
|
||||
$this->_delimiter = $pValue;
|
||||
$this->delimiter = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function getEnclosure()
|
||||
{
|
||||
return $this->_enclosure;
|
||||
return $this->enclosure;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,7 +181,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
if ($pValue == '') {
|
||||
$pValue = null;
|
||||
}
|
||||
$this->_enclosure = $pValue;
|
||||
$this->enclosure = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function getLineEnding()
|
||||
{
|
||||
return $this->_lineEnding;
|
||||
return $this->lineEnding;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -203,7 +203,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function setLineEnding($pValue = PHP_EOL)
|
||||
{
|
||||
$this->_lineEnding = $pValue;
|
||||
$this->lineEnding = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function getUseBOM()
|
||||
{
|
||||
return $this->_useBOM;
|
||||
return $this->useBOM;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -225,7 +225,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function setUseBOM($pValue = false)
|
||||
{
|
||||
$this->_useBOM = $pValue;
|
||||
$this->useBOM = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function getExcelCompatibility()
|
||||
{
|
||||
return $this->_excelCompatibility;
|
||||
return $this->excelCompatibility;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,7 +248,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function setExcelCompatibility($pValue = false)
|
||||
{
|
||||
$this->_excelCompatibility = $pValue;
|
||||
$this->excelCompatibility = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function getSheetIndex()
|
||||
{
|
||||
return $this->_sheetIndex;
|
||||
return $this->sheetIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,7 +270,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
*/
|
||||
public function setSheetIndex($pValue = 0)
|
||||
{
|
||||
$this->_sheetIndex = $pValue;
|
||||
$this->sheetIndex = $pValue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -292,21 +292,21 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
|
|||
|
||||
foreach ($pValues as $element) {
|
||||
// Escape enclosures
|
||||
$element = str_replace($this->_enclosure, $this->_enclosure . $this->_enclosure, $element);
|
||||
$element = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $element);
|
||||
|
||||
// Add delimiter
|
||||
if ($writeDelimiter) {
|
||||
$line .= $this->_delimiter;
|
||||
$line .= $this->delimiter;
|
||||
} else {
|
||||
$writeDelimiter = true;
|
||||
}
|
||||
|
||||
// Add enclosed string
|
||||
$line .= $this->_enclosure . $element . $this->_enclosure;
|
||||
$line .= $this->enclosure . $element . $this->enclosure;
|
||||
}
|
||||
|
||||
// Add line ending
|
||||
$line .= $this->_lineEnding;
|
||||
$line .= $this->lineEnding;
|
||||
|
||||
// Write to file
|
||||
fwrite($pFileHandle, $line);
|
||||
|
|
|
@ -32,63 +32,63 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
*
|
||||
* @var PHPExcel
|
||||
*/
|
||||
private $_phpExcel;
|
||||
private $phpExcel;
|
||||
|
||||
/**
|
||||
* Total number of shared strings in workbook
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_str_total = 0;
|
||||
private $strTotal = 0;
|
||||
|
||||
/**
|
||||
* Number of unique shared strings in workbook
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_str_unique = 0;
|
||||
private $strUnique = 0;
|
||||
|
||||
/**
|
||||
* Array of unique shared strings in workbook
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_str_table = array();
|
||||
private $strTable = array();
|
||||
|
||||
/**
|
||||
* Color cache. Mapping between RGB value and color index.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_colors;
|
||||
private $colors;
|
||||
|
||||
/**
|
||||
* Formula parser
|
||||
*
|
||||
* @var PHPExcel_Writer_Excel5_Parser
|
||||
*/
|
||||
private $_parser;
|
||||
private $parser;
|
||||
|
||||
/**
|
||||
* Identifier clusters for drawings. Used in MSODRAWINGGROUP record.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_IDCLs;
|
||||
private $IDCLs;
|
||||
|
||||
/**
|
||||
* Basic OLE object summary information
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_summaryInformation;
|
||||
private $summaryInformation;
|
||||
|
||||
/**
|
||||
* Extended OLE object document summary information
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_documentSummaryInformation;
|
||||
private $documentSummaryInformation;
|
||||
|
||||
/**
|
||||
* Create a new PHPExcel_Writer_Excel5
|
||||
|
@ -97,9 +97,9 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
*/
|
||||
public function __construct(PHPExcel $phpExcel)
|
||||
{
|
||||
$this->_phpExcel = $phpExcel;
|
||||
$this->phpExcel = $phpExcel;
|
||||
|
||||
$this->_parser = new PHPExcel_Writer_Excel5_Parser();
|
||||
$this->parser = new PHPExcel_Writer_Excel5_Parser();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,38 +112,38 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
{
|
||||
|
||||
// garbage collect
|
||||
$this->_phpExcel->garbageCollect();
|
||||
$this->phpExcel->garbageCollect();
|
||||
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->getWriteDebugLog();
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
||||
$saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
|
||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
|
||||
$saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
|
||||
// initialize colors array
|
||||
$this->_colors = array();
|
||||
$this->colors = array();
|
||||
|
||||
// Initialise workbook writer
|
||||
$this->_writerWorkbook = new PHPExcel_Writer_Excel5_Workbook($this->_phpExcel, $this->_str_total, $this->_str_unique, $this->_str_table, $this->_colors, $this->_parser);
|
||||
$this->_writerWorkbook = new PHPExcel_Writer_Excel5_Workbook($this->phpExcel, $this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser);
|
||||
|
||||
// Initialise worksheet writers
|
||||
$countSheets = $this->_phpExcel->getSheetCount();
|
||||
$countSheets = $this->phpExcel->getSheetCount();
|
||||
for ($i = 0; $i < $countSheets; ++$i) {
|
||||
$this->_writerWorksheets[$i] = new PHPExcel_Writer_Excel5_Worksheet($this->_str_total, $this->_str_unique, $this->_str_table, $this->_colors, $this->_parser, $this->_preCalculateFormulas, $this->_phpExcel->getSheet($i));
|
||||
$this->_writerWorksheets[$i] = new PHPExcel_Writer_Excel5_Worksheet($this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser, $this->_preCalculateFormulas, $this->phpExcel->getSheet($i));
|
||||
}
|
||||
|
||||
// build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook.
|
||||
$this->_buildWorksheetEschers();
|
||||
$this->_buildWorkbookEscher();
|
||||
$this->buildWorksheetEschers();
|
||||
$this->buildWorkbookEscher();
|
||||
|
||||
// add 15 identical cell style Xfs
|
||||
// for now, we use the first cellXf instead of cellStyleXf
|
||||
$cellXfCollection = $this->_phpExcel->getCellXfCollection();
|
||||
$cellXfCollection = $this->phpExcel->getCellXfCollection();
|
||||
for ($i = 0; $i < 15; ++$i) {
|
||||
$this->_writerWorkbook->addXfWriter($cellXfCollection[0], true);
|
||||
}
|
||||
|
||||
// add all the cell Xfs
|
||||
foreach ($this->_phpExcel->getCellXfCollection() as $style) {
|
||||
foreach ($this->phpExcel->getCellXfCollection() as $style) {
|
||||
$this->_writerWorkbook->addXfWriter($style, false);
|
||||
}
|
||||
|
||||
|
@ -184,18 +184,18 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$OLE->append($this->_writerWorksheets[$i]->getData());
|
||||
}
|
||||
|
||||
$this->_documentSummaryInformation = $this->_writeDocumentSummaryInformation();
|
||||
$this->documentSummaryInformation = $this->writeDocumentSummaryInformation();
|
||||
// initialize OLE Document Summary Information
|
||||
if (isset($this->_documentSummaryInformation) && !empty($this->_documentSummaryInformation)) {
|
||||
if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) {
|
||||
$OLE_DocumentSummaryInformation = new PHPExcel_Shared_OLE_PPS_File(PHPExcel_Shared_OLE::Asc2Ucs(chr(5) . 'DocumentSummaryInformation'));
|
||||
$OLE_DocumentSummaryInformation->append($this->_documentSummaryInformation);
|
||||
$OLE_DocumentSummaryInformation->append($this->documentSummaryInformation);
|
||||
}
|
||||
|
||||
$this->_summaryInformation = $this->_writeSummaryInformation();
|
||||
$this->summaryInformation = $this->writeSummaryInformation();
|
||||
// initialize OLE Summary Information
|
||||
if (isset($this->_summaryInformation) && !empty($this->_summaryInformation)) {
|
||||
if (isset($this->summaryInformation) && !empty($this->summaryInformation)) {
|
||||
$OLE_SummaryInformation = new PHPExcel_Shared_OLE_PPS_File(PHPExcel_Shared_OLE::Asc2Ucs(chr(5) . 'SummaryInformation'));
|
||||
$OLE_SummaryInformation->append($this->_summaryInformation);
|
||||
$OLE_SummaryInformation->append($this->summaryInformation);
|
||||
}
|
||||
|
||||
// define OLE Parts
|
||||
|
@ -214,7 +214,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$res = $root->save($pFilename);
|
||||
|
||||
PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType);
|
||||
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||
PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -234,14 +234,14 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
* Build the Worksheet Escher objects
|
||||
*
|
||||
*/
|
||||
private function _buildWorksheetEschers()
|
||||
private function buildWorksheetEschers()
|
||||
{
|
||||
// 1-based index to BstoreContainer
|
||||
$blipIndex = 0;
|
||||
$lastReducedSpId = 0;
|
||||
$lastSpId = 0;
|
||||
|
||||
foreach ($this->_phpExcel->getAllsheets() as $sheet) {
|
||||
foreach ($this->phpExcel->getAllsheets() as $sheet) {
|
||||
// sheet index
|
||||
$sheetIndex = $sheet->getParent()->getIndex($sheet);
|
||||
|
||||
|
@ -385,7 +385,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
}
|
||||
|
||||
// identifier clusters, used for workbook Escher object
|
||||
$this->_IDCLs[$dgId] = $lastReducedSpId;
|
||||
$this->IDCLs[$dgId] = $lastReducedSpId;
|
||||
|
||||
// set last shape index
|
||||
$dgContainer->setLastSpId($lastSpId);
|
||||
|
@ -398,13 +398,13 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
/**
|
||||
* Build the Escher object corresponding to the MSODRAWINGGROUP record
|
||||
*/
|
||||
private function _buildWorkbookEscher()
|
||||
private function buildWorkbookEscher()
|
||||
{
|
||||
$escher = null;
|
||||
|
||||
// any drawings in this workbook?
|
||||
$found = false;
|
||||
foreach ($this->_phpExcel->getAllSheets() as $sheet) {
|
||||
foreach ($this->phpExcel->getAllSheets() as $sheet) {
|
||||
if (count($sheet->getDrawingCollection()) > 0) {
|
||||
$found = true;
|
||||
break;
|
||||
|
@ -424,14 +424,14 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$escher->setDggContainer($dggContainer);
|
||||
|
||||
// set IDCLs (identifier clusters)
|
||||
$dggContainer->setIDCLs($this->_IDCLs);
|
||||
$dggContainer->setIDCLs($this->IDCLs);
|
||||
|
||||
// this loop is for determining maximum shape identifier of all drawing
|
||||
$spIdMax = 0;
|
||||
$totalCountShapes = 0;
|
||||
$countDrawings = 0;
|
||||
|
||||
foreach ($this->_phpExcel->getAllsheets() as $sheet) {
|
||||
foreach ($this->phpExcel->getAllsheets() as $sheet) {
|
||||
$sheetCountShapes = 0; // count number of shapes (minus group shape), in sheet
|
||||
|
||||
if (count($sheet->getDrawingCollection()) > 0) {
|
||||
|
@ -441,7 +441,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
++$sheetCountShapes;
|
||||
++$totalCountShapes;
|
||||
|
||||
$spId = $sheetCountShapes | ($this->_phpExcel->getIndex($sheet) + 1) << 10;
|
||||
$spId = $sheetCountShapes | ($this->phpExcel->getIndex($sheet) + 1) << 10;
|
||||
$spIdMax = max($spId, $spIdMax);
|
||||
}
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dggContainer->setBstoreContainer($bstoreContainer);
|
||||
|
||||
// the BSE's (all the images)
|
||||
foreach ($this->_phpExcel->getAllsheets() as $sheet) {
|
||||
foreach ($this->phpExcel->getAllsheets() as $sheet) {
|
||||
foreach ($sheet->getDrawingCollection() as $drawing) {
|
||||
if ($drawing instanceof PHPExcel_Worksheet_Drawing) {
|
||||
$filename = $drawing->getPath();
|
||||
|
@ -537,7 +537,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
* Build the OLE Part for DocumentSummary Information
|
||||
* @return string
|
||||
*/
|
||||
private function _writeDocumentSummaryInformation()
|
||||
private function writeDocumentSummaryInformation()
|
||||
{
|
||||
// offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark)
|
||||
$data = pack('v', 0xFFFE);
|
||||
|
@ -571,8 +571,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
|
||||
// GKPIDDSI_CATEGORY : Category
|
||||
if ($this->_phpExcel->getProperties()->getCategory()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getCategory();
|
||||
if ($this->phpExcel->getProperties()->getCategory()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getCategory();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x1E),
|
||||
|
@ -733,7 +733,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
* Build the OLE Part for Summary Information
|
||||
* @return string
|
||||
*/
|
||||
private function _writeSummaryInformation()
|
||||
private function writeSummaryInformation()
|
||||
{
|
||||
// offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark)
|
||||
$data = pack('v', 0xFFFE);
|
||||
|
@ -767,8 +767,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
|
||||
// Title
|
||||
if ($this->_phpExcel->getProperties()->getTitle()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getTitle();
|
||||
if ($this->phpExcel->getProperties()->getTitle()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getTitle();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length
|
||||
|
@ -776,8 +776,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
}
|
||||
// Subject
|
||||
if ($this->_phpExcel->getProperties()->getSubject()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getSubject();
|
||||
if ($this->phpExcel->getProperties()->getSubject()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getSubject();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x03),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length
|
||||
|
@ -785,8 +785,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
}
|
||||
// Author (Creator)
|
||||
if ($this->_phpExcel->getProperties()->getCreator()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getCreator();
|
||||
if ($this->phpExcel->getProperties()->getCreator()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getCreator();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x04),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length
|
||||
|
@ -794,8 +794,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
}
|
||||
// Keywords
|
||||
if ($this->_phpExcel->getProperties()->getKeywords()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getKeywords();
|
||||
if ($this->phpExcel->getProperties()->getKeywords()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getKeywords();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x05),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length
|
||||
|
@ -803,8 +803,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
}
|
||||
// Comments (Description)
|
||||
if ($this->_phpExcel->getProperties()->getDescription()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getDescription();
|
||||
if ($this->phpExcel->getProperties()->getDescription()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getDescription();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x06),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length
|
||||
|
@ -812,8 +812,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
}
|
||||
// Last Saved By (LastModifiedBy)
|
||||
if ($this->_phpExcel->getProperties()->getLastModifiedBy()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getLastModifiedBy();
|
||||
if ($this->phpExcel->getProperties()->getLastModifiedBy()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getLastModifiedBy();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x08),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length
|
||||
|
@ -821,8 +821,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
}
|
||||
// Created Date/Time
|
||||
if ($this->_phpExcel->getProperties()->getCreated()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getCreated();
|
||||
if ($this->phpExcel->getProperties()->getCreated()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getCreated();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
|
||||
|
@ -830,8 +830,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
|
|||
$dataSection_NumProps++;
|
||||
}
|
||||
// Modified Date/Time
|
||||
if ($this->_phpExcel->getProperties()->getModified()) {
|
||||
$dataProp = $this->_phpExcel->getProperties()->getModified();
|
||||
if ($this->phpExcel->getProperties()->getModified()) {
|
||||
$dataProp = $this->phpExcel->getProperties()->getModified();
|
||||
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D),
|
||||
'offset' => array('pack' => 'V'),
|
||||
'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
|
||||
|
|
|
@ -75,61 +75,61 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $_isStyleXf;
|
||||
private $isStyleXf;
|
||||
|
||||
/**
|
||||
* Index to the FONT record. Index 4 does not exist
|
||||
* @var integer
|
||||
*/
|
||||
private $_fontIndex;
|
||||
private $fontIndex;
|
||||
|
||||
/**
|
||||
* An index (2 bytes) to a FORMAT record (number format).
|
||||
* @var integer
|
||||
*/
|
||||
public $_numberFormatIndex;
|
||||
private $numberFormatIndex;
|
||||
|
||||
/**
|
||||
* 1 bit, apparently not used.
|
||||
* @var integer
|
||||
*/
|
||||
public $_text_justlast;
|
||||
private $textJustLast;
|
||||
|
||||
/**
|
||||
* The cell's foreground color.
|
||||
* @var integer
|
||||
*/
|
||||
public $_fg_color;
|
||||
private $foregroundColor;
|
||||
|
||||
/**
|
||||
* The cell's background color.
|
||||
* @var integer
|
||||
*/
|
||||
public $_bg_color;
|
||||
private $backgroundColor;
|
||||
|
||||
/**
|
||||
* Color of the bottom border of the cell.
|
||||
* @var integer
|
||||
*/
|
||||
public $_bottom_color;
|
||||
private $bottomBorderColor;
|
||||
|
||||
/**
|
||||
* Color of the top border of the cell.
|
||||
* @var integer
|
||||
*/
|
||||
public $_top_color;
|
||||
private $topBorderColor;
|
||||
|
||||
/**
|
||||
* Color of the left border of the cell.
|
||||
* @var integer
|
||||
*/
|
||||
public $_left_color;
|
||||
private $leftBorderColor;
|
||||
|
||||
/**
|
||||
* Color of the right border of the cell.
|
||||
* @var integer
|
||||
*/
|
||||
public $_right_color;
|
||||
private $rightBorderColor;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -139,22 +139,22 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function __construct(PHPExcel_Style $style = null)
|
||||
{
|
||||
$this->_isStyleXf = false;
|
||||
$this->_fontIndex = 0;
|
||||
$this->isStyleXf = false;
|
||||
$this->fontIndex = 0;
|
||||
|
||||
$this->_numberFormatIndex = 0;
|
||||
$this->numberFormatIndex = 0;
|
||||
|
||||
$this->_text_justlast = 0;
|
||||
$this->textJustLast = 0;
|
||||
|
||||
$this->_fg_color = 0x40;
|
||||
$this->_bg_color = 0x41;
|
||||
$this->foregroundColor = 0x40;
|
||||
$this->backgroundColor = 0x41;
|
||||
|
||||
$this->_diag = 0;
|
||||
|
||||
$this->_bottom_color = 0x40;
|
||||
$this->_top_color = 0x40;
|
||||
$this->_left_color = 0x40;
|
||||
$this->_right_color = 0x40;
|
||||
$this->bottomBorderColor = 0x40;
|
||||
$this->topBorderColor = 0x40;
|
||||
$this->leftBorderColor = 0x40;
|
||||
$this->rightBorderColor = 0x40;
|
||||
$this->_diag_color = 0x40;
|
||||
$this->_style = $style;
|
||||
|
||||
|
@ -169,54 +169,54 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
public function writeXf()
|
||||
{
|
||||
// Set the type of the XF record and some of the attributes.
|
||||
if ($this->_isStyleXf) {
|
||||
if ($this->isStyleXf) {
|
||||
$style = 0xFFF5;
|
||||
} else {
|
||||
$style = self::_mapLocked($this->_style->getProtection()->getLocked());
|
||||
$style |= self::_mapHidden($this->_style->getProtection()->getHidden()) << 1;
|
||||
$style = self::mapLocked($this->_style->getProtection()->getLocked());
|
||||
$style |= self::mapHidden($this->_style->getProtection()->getHidden()) << 1;
|
||||
}
|
||||
|
||||
// Flags to indicate if attributes have been set.
|
||||
$atr_num = ($this->_numberFormatIndex != 0)?1:0;
|
||||
$atr_fnt = ($this->_fontIndex != 0)?1:0;
|
||||
$atr_num = ($this->numberFormatIndex != 0)?1:0;
|
||||
$atr_fnt = ($this->fontIndex != 0)?1:0;
|
||||
$atr_alc = ((int) $this->_style->getAlignment()->getWrapText()) ? 1 : 0;
|
||||
$atr_bdr = (self::_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) ||
|
||||
self::_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) ||
|
||||
self::_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) ||
|
||||
self::_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0;
|
||||
$atr_pat = (($this->_fg_color != 0x40) ||
|
||||
($this->_bg_color != 0x41) ||
|
||||
self::_mapFillType($this->_style->getFill()->getFillType()))?1:0;
|
||||
$atr_prot = self::_mapLocked($this->_style->getProtection()->getLocked())
|
||||
| self::_mapHidden($this->_style->getProtection()->getHidden());
|
||||
$atr_bdr = (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) ||
|
||||
self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) ||
|
||||
self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) ||
|
||||
self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0;
|
||||
$atr_pat = (($this->foregroundColor != 0x40) ||
|
||||
($this->backgroundColor != 0x41) ||
|
||||
self::mapFillType($this->_style->getFill()->getFillType()))?1:0;
|
||||
$atr_prot = self::mapLocked($this->_style->getProtection()->getLocked())
|
||||
| self::mapHidden($this->_style->getProtection()->getHidden());
|
||||
|
||||
// Zero the default border colour if the border has not been set.
|
||||
if (self::_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0) {
|
||||
$this->_bottom_color = 0;
|
||||
if (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0) {
|
||||
$this->bottomBorderColor = 0;
|
||||
}
|
||||
if (self::_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) {
|
||||
$this->_top_color = 0;
|
||||
if (self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) {
|
||||
$this->topBorderColor = 0;
|
||||
}
|
||||
if (self::_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0) {
|
||||
$this->_right_color = 0;
|
||||
if (self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0) {
|
||||
$this->rightBorderColor = 0;
|
||||
}
|
||||
if (self::_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) == 0) {
|
||||
$this->_left_color = 0;
|
||||
if (self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) == 0) {
|
||||
$this->leftBorderColor = 0;
|
||||
}
|
||||
if (self::_mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) == 0) {
|
||||
if (self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) == 0) {
|
||||
$this->_diag_color = 0;
|
||||
}
|
||||
|
||||
$record = 0x00E0; // Record identifier
|
||||
$length = 0x0014; // Number of bytes to follow
|
||||
|
||||
$ifnt = $this->_fontIndex; // Index to FONT record
|
||||
$ifmt = $this->_numberFormatIndex; // Index to FORMAT record
|
||||
$ifnt = $this->fontIndex; // Index to FONT record
|
||||
$ifmt = $this->numberFormatIndex; // Index to FORMAT record
|
||||
|
||||
$align = $this->_mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment
|
||||
$align = $this->mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment
|
||||
$align |= (int) $this->_style->getAlignment()->getWrapText() << 3;
|
||||
$align |= self::_mapVAlign($this->_style->getAlignment()->getVertical()) << 4;
|
||||
$align |= $this->_text_justlast << 7;
|
||||
$align |= self::mapVAlign($this->_style->getAlignment()->getVertical()) << 4;
|
||||
$align |= $this->textJustLast << 7;
|
||||
|
||||
$used_attrib = $atr_num << 2;
|
||||
$used_attrib |= $atr_fnt << 3;
|
||||
|
@ -225,15 +225,15 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
$used_attrib |= $atr_pat << 6;
|
||||
$used_attrib |= $atr_prot << 7;
|
||||
|
||||
$icv = $this->_fg_color; // fg and bg pattern colors
|
||||
$icv |= $this->_bg_color << 7;
|
||||
$icv = $this->foregroundColor; // fg and bg pattern colors
|
||||
$icv |= $this->backgroundColor << 7;
|
||||
|
||||
$border1 = self::_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color
|
||||
$border1 |= self::_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 4;
|
||||
$border1 |= self::_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8;
|
||||
$border1 |= self::_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12;
|
||||
$border1 |= $this->_left_color << 16;
|
||||
$border1 |= $this->_right_color << 23;
|
||||
$border1 = self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color
|
||||
$border1 |= self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 4;
|
||||
$border1 |= self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8;
|
||||
$border1 |= self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12;
|
||||
$border1 |= $this->leftBorderColor << 16;
|
||||
$border1 |= $this->rightBorderColor << 23;
|
||||
|
||||
$diagonalDirection = $this->_style->getBorders()->getDiagonalDirection();
|
||||
$diag_tl_to_rb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH
|
||||
|
@ -243,11 +243,11 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
$border1 |= $diag_tl_to_rb << 30;
|
||||
$border1 |= $diag_tr_to_lb << 31;
|
||||
|
||||
$border2 = $this->_top_color; // Border color
|
||||
$border2 |= $this->_bottom_color << 7;
|
||||
$border2 = $this->topBorderColor; // Border color
|
||||
$border2 |= $this->bottomBorderColor << 7;
|
||||
$border2 |= $this->_diag_color << 14;
|
||||
$border2 |= self::_mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21;
|
||||
$border2 |= self::_mapFillType($this->_style->getFill()->getFillType()) << 26;
|
||||
$border2 |= self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21;
|
||||
$border2 |= self::mapFillType($this->_style->getFill()->getFillType()) << 26;
|
||||
|
||||
$header = pack("vv", $record, $length);
|
||||
|
||||
|
@ -256,7 +256,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
$biff8_options |= (int) $this->_style->getAlignment()->getShrinkToFit() << 4;
|
||||
|
||||
$data = pack("vvvC", $ifnt, $ifmt, $style, $align);
|
||||
$data .= pack("CCC", self::_mapTextRotation($this->_style->getAlignment()->getTextRotation()), $biff8_options, $used_attrib);
|
||||
$data .= pack("CCC", self::mapTextRotation($this->_style->getAlignment()->getTextRotation()), $biff8_options, $used_attrib);
|
||||
$data .= pack("VVv", $border1, $border2, $icv);
|
||||
|
||||
return($header . $data);
|
||||
|
@ -269,7 +269,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setIsStyleXf($value)
|
||||
{
|
||||
$this->_isStyleXf = $value;
|
||||
$this->isStyleXf = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -280,7 +280,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setBottomColor($colorIndex)
|
||||
{
|
||||
$this->_bottom_color = $colorIndex;
|
||||
$this->bottomBorderColor = $colorIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -291,7 +291,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setTopColor($colorIndex)
|
||||
{
|
||||
$this->_top_color = $colorIndex;
|
||||
$this->topBorderColor = $colorIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -302,7 +302,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setLeftColor($colorIndex)
|
||||
{
|
||||
$this->_left_color = $colorIndex;
|
||||
$this->leftBorderColor = $colorIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -313,7 +313,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setRightColor($colorIndex)
|
||||
{
|
||||
$this->_right_color = $colorIndex;
|
||||
$this->rightBorderColor = $colorIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -336,7 +336,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setFgColor($colorIndex)
|
||||
{
|
||||
$this->_fg_color = $colorIndex;
|
||||
$this->foregroundColor = $colorIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -347,7 +347,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setBgColor($colorIndex)
|
||||
{
|
||||
$this->_bg_color = $colorIndex;
|
||||
$this->backgroundColor = $colorIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -359,7 +359,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setNumberFormatIndex($numberFormatIndex)
|
||||
{
|
||||
$this->_numberFormatIndex = $numberFormatIndex;
|
||||
$this->numberFormatIndex = $numberFormatIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -369,7 +369,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
*/
|
||||
public function setFontIndex($value)
|
||||
{
|
||||
$this->_fontIndex = $value;
|
||||
$this->fontIndex = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -377,7 +377,8 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @static array of int
|
||||
*
|
||||
*/
|
||||
private static $_mapBorderStyle = array ( PHPExcel_Style_Border::BORDER_NONE => 0x00,
|
||||
private static $mapBorderStyles = array(
|
||||
PHPExcel_Style_Border::BORDER_NONE => 0x00,
|
||||
PHPExcel_Style_Border::BORDER_THIN => 0x01,
|
||||
PHPExcel_Style_Border::BORDER_MEDIUM => 0x02,
|
||||
PHPExcel_Style_Border::BORDER_DASHED => 0x03,
|
||||
|
@ -399,10 +400,10 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @param string $borderStyle
|
||||
* @return int
|
||||
*/
|
||||
private static function _mapBorderStyle($borderStyle)
|
||||
private static function mapBorderStyle($borderStyle)
|
||||
{
|
||||
if (isset(self::$_mapBorderStyle[$borderStyle])) {
|
||||
return self::$_mapBorderStyle[$borderStyle];
|
||||
if (isset(self::$mapBorderStyles[$borderStyle])) {
|
||||
return self::$mapBorderStyles[$borderStyle];
|
||||
}
|
||||
return 0x00;
|
||||
}
|
||||
|
@ -412,7 +413,8 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @static array of int
|
||||
*
|
||||
*/
|
||||
private static $_mapFillType = array( PHPExcel_Style_Fill::FILL_NONE => 0x00,
|
||||
private static $mapFillTypes = array(
|
||||
PHPExcel_Style_Fill::FILL_NONE => 0x00,
|
||||
PHPExcel_Style_Fill::FILL_SOLID => 0x01,
|
||||
PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY => 0x02,
|
||||
PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY => 0x03,
|
||||
|
@ -434,16 +436,17 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR => 0x00, // does not exist in BIFF8
|
||||
PHPExcel_Style_Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8
|
||||
);
|
||||
|
||||
/**
|
||||
* Map fill type
|
||||
*
|
||||
* @param string $fillType
|
||||
* @return int
|
||||
*/
|
||||
private static function _mapFillType($fillType)
|
||||
private static function mapFillType($fillType)
|
||||
{
|
||||
if (isset(self::$_mapFillType[$fillType])) {
|
||||
return self::$_mapFillType[$fillType];
|
||||
if (isset(self::$mapFillTypes[$fillType])) {
|
||||
return self::$mapFillTypes[$fillType];
|
||||
}
|
||||
return 0x00;
|
||||
}
|
||||
|
@ -453,7 +456,8 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @static array of int
|
||||
*
|
||||
*/
|
||||
private static $_mapHAlign = array( PHPExcel_Style_Alignment::HORIZONTAL_GENERAL => 0,
|
||||
private static $mapHAlignments = array(
|
||||
PHPExcel_Style_Alignment::HORIZONTAL_GENERAL => 0,
|
||||
PHPExcel_Style_Alignment::HORIZONTAL_LEFT => 1,
|
||||
PHPExcel_Style_Alignment::HORIZONTAL_CENTER => 2,
|
||||
PHPExcel_Style_Alignment::HORIZONTAL_RIGHT => 3,
|
||||
|
@ -461,16 +465,17 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY => 5,
|
||||
PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6,
|
||||
);
|
||||
|
||||
/**
|
||||
* Map to BIFF2-BIFF8 codes for horizontal alignment
|
||||
*
|
||||
* @param string $hAlign
|
||||
* @return int
|
||||
*/
|
||||
private function _mapHAlign($hAlign)
|
||||
private function mapHAlign($hAlign)
|
||||
{
|
||||
if (isset(self::$_mapHAlign[$hAlign])) {
|
||||
return self::$_mapHAlign[$hAlign];
|
||||
if (isset(self::$mapHAlignments[$hAlign])) {
|
||||
return self::$mapHAlignments[$hAlign];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -480,21 +485,23 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @static array of int
|
||||
*
|
||||
*/
|
||||
private static $_mapVAlign = array( PHPExcel_Style_Alignment::VERTICAL_TOP => 0,
|
||||
private static $mapVAlignments = array(
|
||||
PHPExcel_Style_Alignment::VERTICAL_TOP => 0,
|
||||
PHPExcel_Style_Alignment::VERTICAL_CENTER => 1,
|
||||
PHPExcel_Style_Alignment::VERTICAL_BOTTOM => 2,
|
||||
PHPExcel_Style_Alignment::VERTICAL_JUSTIFY => 3,
|
||||
);
|
||||
|
||||
/**
|
||||
* Map to BIFF2-BIFF8 codes for vertical alignment
|
||||
*
|
||||
* @param string $vAlign
|
||||
* @return int
|
||||
*/
|
||||
private static function _mapVAlign($vAlign)
|
||||
private static function mapVAlign($vAlign)
|
||||
{
|
||||
if (isset(self::$_mapVAlign[$vAlign])) {
|
||||
return self::$_mapVAlign[$vAlign];
|
||||
if (isset(self::$mapVAlignments[$vAlign])) {
|
||||
return self::$mapVAlignments[$vAlign];
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
@ -505,15 +512,13 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @param int $textRotation
|
||||
* @return int
|
||||
*/
|
||||
private static function _mapTextRotation($textRotation)
|
||||
private static function mapTextRotation($textRotation)
|
||||
{
|
||||
if ($textRotation >= 0) {
|
||||
return $textRotation;
|
||||
}
|
||||
if ($textRotation == -165) {
|
||||
} elseif ($textRotation == -165) {
|
||||
return 255;
|
||||
}
|
||||
if ($textRotation < 0) {
|
||||
} elseif ($textRotation < 0) {
|
||||
return 90 - $textRotation;
|
||||
}
|
||||
}
|
||||
|
@ -524,7 +529,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @param string
|
||||
* @return int
|
||||
*/
|
||||
private static function _mapLocked($locked)
|
||||
private static function mapLocked($locked)
|
||||
{
|
||||
switch ($locked) {
|
||||
case PHPExcel_Style_Protection::PROTECTION_INHERIT:
|
||||
|
@ -544,7 +549,7 @@ class PHPExcel_Writer_Excel5_Xf
|
|||
* @param string
|
||||
* @return int
|
||||
*/
|
||||
private static function _mapHidden($hidden)
|
||||
private static function mapHidden($hidden)
|
||||
{
|
||||
switch ($hidden) {
|
||||
case PHPExcel_Style_Protection::PROTECTION_INHERIT:
|
||||
|
|
|
@ -32,14 +32,14 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_tempDir = '';
|
||||
protected $tempDir = '';
|
||||
|
||||
/**
|
||||
* Font
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_font = 'freesans';
|
||||
protected $font = 'freesans';
|
||||
|
||||
/**
|
||||
* Orientation (Over-ride)
|
||||
|
@ -212,7 +212,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
|||
{
|
||||
parent::__construct($phpExcel);
|
||||
$this->setUseInlineCss(true);
|
||||
$this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir();
|
||||
$this->tempDir = PHPExcel_Shared_File::sys_get_temp_dir();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -222,7 +222,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
|||
*/
|
||||
public function getFont()
|
||||
{
|
||||
return $this->_font;
|
||||
return $this->font;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -236,7 +236,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
|||
*/
|
||||
public function setFont($fontName)
|
||||
{
|
||||
$this->_font = $fontName;
|
||||
$this->font = $fontName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
|||
*/
|
||||
public function getTempDir()
|
||||
{
|
||||
return $this->_tempDir;
|
||||
return $this->tempDir;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -304,7 +304,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
|
|||
public function setTempDir($pValue = '')
|
||||
{
|
||||
if (is_dir($pValue)) {
|
||||
$this->_tempDir = $pValue;
|
||||
$this->tempDir = $pValue;
|
||||
} else {
|
||||
throw new PHPExcel_Writer_Exception("Directory does not exist: $pValue");
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ class AutoloaderTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -52,5 +51,4 @@ class AutoloaderTest extends PHPUnit_Framework_TestCase
|
|||
// ... of the correct type
|
||||
$this->assertTrue(is_a($result, 'PHPExcel_Calculation_Function'));
|
||||
}
|
||||
|
||||
}
|
|
@ -8,8 +8,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -25,7 +24,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DATE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDATE()
|
||||
|
@ -38,7 +37,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::DATE(2012, 1, 31);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
||||
$this->assertEquals(1327968000, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function testDATEtoPHPObject()
|
||||
|
@ -78,7 +77,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DATEVALUE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDATEVALUE()
|
||||
|
@ -91,7 +90,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
||||
$this->assertEquals(1327968000, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function testDATEVALUEtoPHPObject()
|
||||
|
@ -115,7 +114,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'YEAR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerYEAR()
|
||||
|
@ -131,7 +130,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'MONTHOFYEAR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerMONTH()
|
||||
|
@ -147,7 +146,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'WEEKOFYEAR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerWEEKNUM()
|
||||
|
@ -163,7 +162,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DAYOFWEEK'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerWEEKDAY()
|
||||
|
@ -179,7 +178,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DAYOFMONTH'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDAY()
|
||||
|
@ -195,7 +194,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'TIME'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerTIME()
|
||||
|
@ -208,7 +207,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::TIME(7, 30, 20);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(27020, $result, NULL, 1E-8);
|
||||
$this->assertEquals(27020, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function testTIMEtoPHPObject()
|
||||
|
@ -232,7 +231,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'TIMEVALUE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerTIMEVALUE()
|
||||
|
@ -245,7 +244,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(23420, $result, NULL, 1E-8);
|
||||
$this->assertEquals(23420, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function testTIMEVALUEtoPHPObject()
|
||||
|
@ -269,7 +268,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'HOUROFDAY'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerHOUR()
|
||||
|
@ -285,7 +284,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'MINUTEOFHOUR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerMINUTE()
|
||||
|
@ -301,7 +300,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'SECONDOFMINUTE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerSECOND()
|
||||
|
@ -317,7 +316,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'NETWORKDAYS'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNETWORKDAYS()
|
||||
|
@ -333,7 +332,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'WORKDAY'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerWORKDAY()
|
||||
|
@ -349,7 +348,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'EDATE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerEDATE()
|
||||
|
@ -362,7 +361,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26', -1);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1324857600, $result, NULL, 1E-8);
|
||||
$this->assertEquals(1324857600, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function testEDATEtoPHPObject()
|
||||
|
@ -386,7 +385,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'EOMONTH'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerEOMONTH()
|
||||
|
@ -399,7 +398,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26', -1);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1325289600, $result, NULL, 1E-8);
|
||||
$this->assertEquals(1325289600, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function testEOMONTHtoPHPObject()
|
||||
|
@ -423,7 +422,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DATEDIF'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDATEDIF()
|
||||
|
@ -439,7 +438,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'DAYS360'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDAYS360()
|
||||
|
@ -455,12 +454,11 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime', 'YEARFRAC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerYEARFRAC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,8 +12,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -29,7 +28,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELI'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELI()
|
||||
|
@ -45,7 +44,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELJ'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELJ()
|
||||
|
@ -61,7 +60,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELK'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELK()
|
||||
|
@ -77,7 +76,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELY'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELY()
|
||||
|
@ -109,7 +108,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMAGINARY'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMAGINARY()
|
||||
|
@ -125,7 +124,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMREAL'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMREAL()
|
||||
|
@ -141,7 +140,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMABS'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMABS()
|
||||
|
@ -157,7 +156,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMARGUMENT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMARGUMENT()
|
||||
|
@ -174,8 +173,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCONJUGATE'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMCONJUGATE()
|
||||
|
@ -192,8 +190,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCOS'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMCOS()
|
||||
|
@ -210,8 +207,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMDIV'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMDIV()
|
||||
|
@ -228,8 +224,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMEXP'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMEXP()
|
||||
|
@ -246,8 +241,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLN'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMLN()
|
||||
|
@ -264,8 +258,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG2'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMLOG2()
|
||||
|
@ -282,8 +275,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG10'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMLOG10()
|
||||
|
@ -300,8 +292,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPOWER'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMPOWER()
|
||||
|
@ -318,8 +309,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPRODUCT'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMPRODUCT()
|
||||
|
@ -336,8 +326,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSIN'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSIN()
|
||||
|
@ -354,8 +343,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSQRT'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSQRT()
|
||||
|
@ -372,8 +360,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUB'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSUB()
|
||||
|
@ -390,8 +377,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUM'), $args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSUM()
|
||||
|
@ -407,7 +393,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERF'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerERF()
|
||||
|
@ -423,7 +409,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERFC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerERFC()
|
||||
|
@ -487,7 +473,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOBIN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerDEC2BIN()
|
||||
|
@ -503,7 +489,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOHEX'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerDEC2HEX()
|
||||
|
@ -519,7 +505,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOOCT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerDEC2OCT()
|
||||
|
@ -535,7 +521,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOBIN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerHEX2BIN()
|
||||
|
@ -551,7 +537,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTODEC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerHEX2DEC()
|
||||
|
@ -567,7 +553,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOOCT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerHEX2OCT()
|
||||
|
@ -583,7 +569,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOBIN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerOCT2BIN()
|
||||
|
@ -599,7 +585,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTODEC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerOCT2DEC()
|
||||
|
@ -615,7 +601,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOHEX'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerOCT2HEX()
|
||||
|
@ -631,7 +617,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DELTA'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerDELTA()
|
||||
|
@ -647,7 +633,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','GESTEP'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerGESTEP()
|
||||
|
@ -687,12 +673,11 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','CONVERTUOM'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
$this->assertEquals($expectedResult, $result, null);
|
||||
}
|
||||
|
||||
public function providerCONVERTUOM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -25,7 +24,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerACCRINT()
|
||||
|
@ -41,7 +40,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINTM'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerACCRINTM()
|
||||
|
@ -57,7 +56,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORDEGRC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerAMORDEGRC()
|
||||
|
@ -73,7 +72,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORLINC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerAMORLINC()
|
||||
|
@ -89,7 +88,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYBS'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPDAYBS()
|
||||
|
@ -105,7 +104,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYS'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPDAYS()
|
||||
|
@ -121,7 +120,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYSNC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPDAYSNC()
|
||||
|
@ -137,7 +136,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNCD'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPNCD()
|
||||
|
@ -153,7 +152,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNUM'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPNUM()
|
||||
|
@ -169,7 +168,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPPCD'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPPCD()
|
||||
|
@ -185,7 +184,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMIPMT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCUMIPMT()
|
||||
|
@ -201,7 +200,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMPRINC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCUMPRINC()
|
||||
|
@ -217,7 +216,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DB'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDB()
|
||||
|
@ -233,7 +232,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DDB'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDDB()
|
||||
|
@ -249,7 +248,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DISC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDISC()
|
||||
|
@ -265,7 +264,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARDE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDOLLARDE()
|
||||
|
@ -281,7 +280,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARFR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDOLLARFR()
|
||||
|
@ -297,7 +296,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','EFFECT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerEFFECT()
|
||||
|
@ -313,7 +312,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FV'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerFV()
|
||||
|
@ -329,7 +328,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FVSCHEDULE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerFVSCHEDULE()
|
||||
|
@ -345,7 +344,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','INTRATE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerINTRATE()
|
||||
|
@ -361,7 +360,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IPMT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIPMT()
|
||||
|
@ -377,7 +376,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IRR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIRR()
|
||||
|
@ -393,7 +392,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ISPMT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerISPMT()
|
||||
|
@ -409,7 +408,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','MIRR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerMIRR()
|
||||
|
@ -425,7 +424,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NOMINAL'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNOMINAL()
|
||||
|
@ -441,7 +440,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPER'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNPER()
|
||||
|
@ -457,7 +456,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPV'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNPV()
|
||||
|
@ -473,7 +472,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','PRICE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerPRICE()
|
||||
|
@ -489,7 +488,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','RATE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerRATE()
|
||||
|
@ -505,12 +504,11 @@ class FinancialTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','XIRR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerXIRR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/XIRR.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -55,7 +54,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function testNULL()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::NULL();
|
||||
$result = PHPExcel_Calculation_Functions::null();
|
||||
$this->assertEquals('#NULL!', $result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +72,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_BLANK()
|
||||
|
@ -89,7 +88,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_ERR()
|
||||
|
@ -105,7 +104,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_ERROR()
|
||||
|
@ -121,7 +120,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerERROR_TYPE()
|
||||
|
@ -137,7 +136,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_LOGICAL()
|
||||
|
@ -153,7 +152,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_NA()
|
||||
|
@ -169,7 +168,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_NUMBER()
|
||||
|
@ -185,7 +184,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_TEXT()
|
||||
|
@ -201,7 +200,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_NONTEXT()
|
||||
|
@ -217,7 +216,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_EVEN()
|
||||
|
@ -233,7 +232,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_ODD()
|
||||
|
@ -249,7 +248,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerTYPE()
|
||||
|
@ -265,12 +264,11 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -20,13 +19,13 @@ class LogicalTest extends PHPUnit_Framework_TestCase
|
|||
public function testTRUE()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Logical::TRUE();
|
||||
$this->assertEquals(TRUE, $result);
|
||||
$this->assertEquals(true, $result);
|
||||
}
|
||||
|
||||
public function testFALSE()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Logical::FALSE();
|
||||
$this->assertEquals(FALSE, $result);
|
||||
$this->assertEquals(false, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -108,5 +107,4 @@ class LogicalTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -48,5 +47,4 @@ class LookupRefTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/LookupRef/VLOOKUP.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -25,7 +24,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerATAN2()
|
||||
|
@ -41,7 +40,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerCEILING()
|
||||
|
@ -57,7 +56,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerCOMBIN()
|
||||
|
@ -73,7 +72,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerEVEN()
|
||||
|
@ -89,7 +88,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerODD()
|
||||
|
@ -105,7 +104,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerFACT()
|
||||
|
@ -121,7 +120,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerFACTDOUBLE()
|
||||
|
@ -137,7 +136,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerFLOOR()
|
||||
|
@ -153,7 +152,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerGCD()
|
||||
|
@ -169,7 +168,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerLCM()
|
||||
|
@ -201,7 +200,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSIGN()
|
||||
|
@ -217,7 +216,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerPOWER()
|
||||
|
@ -233,7 +232,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerLOG()
|
||||
|
@ -249,7 +248,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMOD()
|
||||
|
@ -265,7 +264,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMDETERM()
|
||||
|
@ -281,7 +280,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMINVERSE()
|
||||
|
@ -297,7 +296,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMMULT()
|
||||
|
@ -313,7 +312,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMULTINOMIAL()
|
||||
|
@ -331,7 +330,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'), $args);
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMROUND()
|
||||
|
@ -347,7 +346,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerPRODUCT()
|
||||
|
@ -363,7 +362,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerQUOTIENT()
|
||||
|
@ -379,7 +378,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerROUNDUP()
|
||||
|
@ -395,7 +394,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerROUNDDOWN()
|
||||
|
@ -411,7 +410,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSERIESSUM()
|
||||
|
@ -427,7 +426,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSUMSQ()
|
||||
|
@ -443,7 +442,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerTRUNC()
|
||||
|
@ -475,7 +474,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSQRTPI()
|
||||
|
@ -491,7 +490,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig', 'SUMIF'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSUMIF()
|
||||
|
@ -556,5 +555,4 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -354,12 +353,11 @@ class TextDataTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData', 'VALUE'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-8);
|
||||
}
|
||||
|
||||
public function providerVALUE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/VALUE.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ require_once 'testDataFileIterator.php';
|
|||
|
||||
class CalculationTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
|
@ -33,5 +32,4 @@ class CalculationTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/CalculationBinaryComparisonOperation.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class AdvancedValueBinderTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_Shared_String::setDecimalSeparator($decimalSeparator);
|
||||
PHPExcel_Shared_String::setThousandsSeparator($thousandsSeparator);
|
||||
|
||||
$cell = new PHPExcel_Cell(NULL, PHPExcel_Cell_DataType::TYPE_STRING, $sheet);
|
||||
$cell = new PHPExcel_Cell(null, PHPExcel_Cell_DataType::TYPE_STRING, $sheet);
|
||||
|
||||
$binder = new PHPExcel_Cell_AdvancedValueBinder();
|
||||
$binder->bindValue($cell, $value);
|
||||
|
|
|
@ -6,8 +6,7 @@ class DataTypeTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -20,5 +19,4 @@ class DataTypeTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertGreaterThan(0, count($result));
|
||||
$this->assertArrayHasKey('#NULL!', $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ class DefaultValueBinderTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
|
|
@ -6,8 +6,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -40,7 +39,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
$tooltipValue = 'PHPExcel Web Site';
|
||||
|
||||
$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $tooltipValue);
|
||||
$testInstance = new PHPExcel_Cell_Hyperlink(null, $tooltipValue);
|
||||
|
||||
$result = $testInstance->getTooltip();
|
||||
$this->assertEquals($tooltipValue, $result);
|
||||
|
@ -51,7 +50,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
|
|||
$initialTooltipValue = 'PHPExcel Web Site';
|
||||
$newTooltipValue = 'PHPExcel Repository on Github';
|
||||
|
||||
$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $initialTooltipValue);
|
||||
$testInstance = new PHPExcel_Cell_Hyperlink(null, $initialTooltipValue);
|
||||
$result = $testInstance->setTooltip($newTooltipValue);
|
||||
$this->assertTrue($result instanceof PHPExcel_Cell_Hyperlink);
|
||||
|
||||
|
@ -84,5 +83,4 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
|
|||
$result = $testInstance->getHashCode();
|
||||
$this->assertEquals($initialExpectedHash, $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -291,5 +291,4 @@ class CellTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/CellExtractAllCellReferencesInRange.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -51,5 +50,4 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
|
|||
$result = $testInstance->getDataType();
|
||||
$this->assertEquals($dataTypeValue, $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ class LayoutTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -33,5 +32,4 @@ class LayoutTest extends PHPUnit_Framework_TestCase
|
|||
$result = $testInstance->getLayoutTarget();
|
||||
$this->assertEquals($LayoutTargetValue, $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -97,8 +96,8 @@ class LegendTest extends PHPUnit_Framework_TestCase
|
|||
public function testSetOverlay()
|
||||
{
|
||||
$overlayValues = array(
|
||||
TRUE,
|
||||
FALSE,
|
||||
true,
|
||||
false,
|
||||
);
|
||||
|
||||
$testInstance = new PHPExcel_Chart_Legend;
|
||||
|
@ -122,7 +121,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function testGetOverlay()
|
||||
{
|
||||
$OverlayValue = TRUE;
|
||||
$OverlayValue = true;
|
||||
|
||||
$testInstance = new PHPExcel_Chart_Legend;
|
||||
$setValue = $testInstance->setOverlay($OverlayValue);
|
||||
|
@ -130,5 +129,4 @@ class LegendTest extends PHPUnit_Framework_TestCase
|
|||
$result = $testInstance->getOverlay();
|
||||
$this->assertEquals($OverlayValue, $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,5 +51,4 @@ class XEEValidatorTest extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
return $tests;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,5 +54,4 @@ class ReferenceHelperTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($columnExpectedResult[$key], $value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -53,5 +53,4 @@ class CodePageTest extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
$this->fail('An expected exception has not been raised.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ class DateTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-5);
|
||||
}
|
||||
|
||||
public function providerDateTimePHPToExcel1900()
|
||||
|
@ -92,7 +92,7 @@ class DateTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Shared_Date','FormattedPHPToExcel'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-5);
|
||||
}
|
||||
|
||||
public function providerDateTimeFormattedPHPToExcel1900()
|
||||
|
@ -137,7 +137,7 @@ class DateTest extends PHPUnit_Framework_TestCase
|
|||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
|
||||
$this->assertEquals($expectedResult, $result, null, 1E-5);
|
||||
}
|
||||
|
||||
public function providerDateTimePHPToExcel1904()
|
||||
|
@ -184,5 +184,4 @@ class DateTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900Timezone.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class FileTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function testGetUseUploadTempDirectory()
|
||||
{
|
||||
$expectedResult = FALSE;
|
||||
$expectedResult = false;
|
||||
|
||||
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
|
@ -25,8 +25,8 @@ class FileTest extends PHPUnit_Framework_TestCase
|
|||
public function testSetUseUploadTempDirectory()
|
||||
{
|
||||
$useUploadTempDirectoryValues = array(
|
||||
TRUE,
|
||||
FALSE,
|
||||
true,
|
||||
false,
|
||||
);
|
||||
|
||||
foreach ($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
|
||||
|
|
|
@ -90,5 +90,4 @@ class FontTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/Shared/CentimeterSizeToPixels.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,5 +29,4 @@ class PasswordHasherTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/Shared/PasswordHashes.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -79,5 +79,4 @@ class StringTest extends PHPUnit_Framework_TestCase
|
|||
$result = call_user_func(array('PHPExcel_Shared_String','getCurrencyCode'));
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,5 +35,4 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase
|
|||
$result = call_user_func(array('PHPExcel_Shared_TimeZone','setTimezone'), $unsupportedTimezone);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -77,5 +77,4 @@ class ColorTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/Style/ColorChangeBrightness.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,5 +32,4 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
return new testDataFileIterator('rawTestData/Style/NumberFormat.data');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,5 +105,4 @@ class RuleTest extends PHPUnit_Framework_TestCase
|
|||
$result = clone $this->_testAutoFilterRuleObject;
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -169,5 +169,4 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
|
|||
$result = clone $this->_testAutoFilterColumnObject;
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -336,5 +336,4 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
|
|||
$result = clone $this->_testAutoFilterObject;
|
||||
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,8 +5,7 @@ class CellCollectionTest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT')) {
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
@ -27,5 +26,4 @@ class CellCollectionTest extends PHPUnit_Framework_TestCase
|
|||
PHPExcel_CachedObjectStorageFactory::finalize();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -83,5 +83,4 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase
|
|||
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
|
||||
$iterator->prev();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -85,5 +85,4 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase
|
|||
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
|
||||
$iterator->prev();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue