upgrade to PHPExcel 1.7.2

This commit is contained in:
Dieter Adriaenssens
2010-05-02 21:01:53 +02:00
parent 798def6e45
commit b90a1b496b
118 changed files with 9154 additions and 4035 deletions

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -43,7 +43,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Alignment implements PHPExcel_IComparable
{
@@ -190,9 +190,9 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -201,9 +201,9 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -238,7 +238,7 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('horizontal', $pStyles)) {
$this->setHorizontal($pStyles['horizontal']);
@@ -290,7 +290,7 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('horizontal' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
}
else {
$this->_horizontal = $pValue;
@@ -323,7 +323,7 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('vertical' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_vertical = $pValue;
}
@@ -359,7 +359,7 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
if ( ($pValue >= -90 && $pValue <= 90) || $pValue == -165 ) {
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('rotation' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_textRotation = $pValue;
}
@@ -394,7 +394,7 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('wrap' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_wrapText = $pValue;
}
@@ -425,7 +425,7 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('shrinkToFit' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_shrinkToFit = $pValue;
}
@@ -458,7 +458,7 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('indent' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_indent = $pValue;
}
@@ -485,37 +485,6 @@ class PHPExcel_Style_Alignment implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -46,7 +46,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Border implements PHPExcel_IComparable
{
@@ -200,9 +200,9 @@ class PHPExcel_Style_Border implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -211,9 +211,9 @@ class PHPExcel_Style_Border implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -289,7 +289,7 @@ class PHPExcel_Style_Border implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('style', $pStyles)) {
$this->setBorderStyle($pStyles['style']);
@@ -329,7 +329,7 @@ class PHPExcel_Style_Border implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('style' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_borderStyle = $pValue;
}
@@ -358,7 +358,7 @@ class PHPExcel_Style_Border implements PHPExcel_IComparable
if ($this->_isSupervisor) {
$styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB()));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_color = $color;
}
@@ -381,37 +381,6 @@ class PHPExcel_Style_Border implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -46,7 +46,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Borders implements PHPExcel_IComparable
{
@@ -54,6 +54,7 @@ class PHPExcel_Style_Borders implements PHPExcel_IComparable
const DIAGONAL_NONE = 0;
const DIAGONAL_UP = 1;
const DIAGONAL_DOWN = 2;
const DIAGONAL_BOTH = 3;
/**
* Left
@@ -241,9 +242,9 @@ class PHPExcel_Style_Borders implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -252,9 +253,9 @@ class PHPExcel_Style_Borders implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -309,7 +310,7 @@ class PHPExcel_Style_Borders implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('left', $pStyles)) {
$this->getLeft()->applyFromArray($pStyles['left']);
@@ -470,7 +471,7 @@ class PHPExcel_Style_Borders implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_diagonalDirection = $pValue;
}
@@ -497,37 +498,6 @@ class PHPExcel_Style_Borders implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -43,7 +43,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Color implements PHPExcel_IComparable
{
@@ -171,9 +171,9 @@ class PHPExcel_Style_Color implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -182,9 +182,9 @@ class PHPExcel_Style_Color implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -226,7 +226,7 @@ class PHPExcel_Style_Color implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('rgb', $pStyles)) {
$this->setRGB($pStyles['rgb']);
@@ -265,7 +265,7 @@ class PHPExcel_Style_Color implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('argb' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_argb = $pValue;
}
@@ -296,7 +296,7 @@ class PHPExcel_Style_Color implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('argb' => 'FF' . $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_argb = 'FF' . $pValue;
}
@@ -404,37 +404,6 @@ class PHPExcel_Style_Color implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -46,7 +46,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Conditional implements PHPExcel_IComparable
{
@@ -276,37 +276,6 @@ class PHPExcel_Style_Conditional implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -46,7 +46,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Fill implements PHPExcel_IComparable
{
@@ -192,9 +192,9 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -203,9 +203,9 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -244,7 +244,7 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('type', $pStyles)) {
$this->setFillType($pStyles['type']);
@@ -289,7 +289,7 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
public function setFillType($pValue = PHPExcel_Style_Fill::FILL_NONE) {
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('type' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_fillType = $pValue;
}
@@ -317,7 +317,7 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
public function setRotation($pValue = 0) {
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('rotation' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_rotation = $pValue;
}
@@ -346,7 +346,7 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
if ($this->_isSupervisor) {
$styleArray = $this->getStartColor()->getStyleArray(array('argb' => $color->getARGB()));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_startColor = $color;
}
@@ -375,7 +375,7 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
if ($this->_isSupervisor) {
$styleArray = $this->getEndColor()->getStyleArray(array('argb' => $color->getARGB()));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_endColor = $color;
}
@@ -400,37 +400,6 @@ class PHPExcel_Style_Fill implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -46,7 +46,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Font implements PHPExcel_IComparable
{
@@ -207,9 +207,9 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -218,9 +218,9 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -259,7 +259,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('name', $pStyles)) {
$this->setName($pStyles['name']);
@@ -319,7 +319,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('name' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_name = $pValue;
}
@@ -350,7 +350,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('size' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_size = $pValue;
}
@@ -381,7 +381,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('bold' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_bold = $pValue;
}
@@ -412,7 +412,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('italic' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_italic = $pValue;
}
@@ -443,7 +443,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('superScript' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_superScript = $pValue;
$this->_subScript = !$pValue;
@@ -475,7 +475,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('subScript' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_subScript = $pValue;
$this->_superScript = !$pValue;
@@ -507,7 +507,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('underline' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_underline = $pValue;
}
@@ -559,7 +559,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('strike' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_strikethrough = $pValue;
}
@@ -588,7 +588,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
if ($this->_isSupervisor) {
$styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB()));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_color = $color;
}
@@ -618,37 +618,6 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,9 +20,9 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.7.0, 2009-08-10
* @version 1.7.2, 2010-01-11
*/
@@ -49,7 +49,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/Calculation/Functions.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
{
@@ -203,9 +203,9 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -214,9 +214,9 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -248,7 +248,7 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('code', $pStyles)) {
$this->setFormatCode($pStyles['code']);
@@ -288,7 +288,7 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('code' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_formatCode = $pValue;
$this->_builtInFormatCode = self::builtInFormatCodeIndex($pValue);
@@ -318,7 +318,7 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('code' => self::builtInFormatCode($pValue)));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_builtInFormatCode = $pValue;
$this->_formatCode = self::builtInFormatCode($pValue);
@@ -446,37 +446,6 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
@@ -491,15 +460,59 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
}
}
private static $_dateFormatReplacements = array(
// first remove escapes related to non-format characters
'\\' => '',
// 12-hour suffix
'am/pm' => 'A',
// 4-digit year
'yyyy' => 'Y',
// 2-digit year
'yy' => 'y',
// first letter of month - no php equivalent
'mmmmm' => 'M',
// full month name
'mmmm' => 'F',
// short month name
'mmm' => 'M',
// mm is minutes if time or month w/leading zero
':mm' => ':i',
// month leading zero
'mm' => 'm',
// month no leading zero
'm' => 'n',
// full day of week name
'dddd' => 'l',
// short day of week name
'ddd' => 'D',
// days leading zero
'dd' => 'd',
// days no leading zero
'd' => 'j',
// seconds
'ss' => 's',
// fractional seconds - no php equivalent
'.s' => ''
);
private static $_dateFormatReplacements24 = array(
'hh' => 'H',
'h' => 'G'
);
private static $_dateFormatReplacements12 = array(
'hh' => 'h',
'h' => 'g'
);
/**
* Convert a value in a pre-defined format to a PHP string
*
* @param mixed $value Value to format
* @param string $format Format code
* @param array $callBack Callback function for additional formatting of string
* @return string Formatted string
*/
public static function toFormattedString($value = '', $format = '') {
// For now we do not treat strings although part 4 of a format code affects strings
public static function toFormattedString($value = '', $format = '', $callBack = null) {
// For now we do not treat strings although section 4 of a format code affects strings
if (!is_numeric($value)) return $value;
// For 'General' format code, we just pass the value although this is not entirely the way Excel does it,
@@ -508,82 +521,94 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
return $value;
}
// Get the parts, there can be up to four parts
$parts = explode(';', $format);
// Get the sections, there can be up to four sections
$sections = explode(';', $format);
// We should really fetch the relevant part depending on whether we have a positive number,
// negative number, zero, or text. But for now we just use first part
$format = $parts[0];
// Fetch the relevant section depending on whether number is positive, negative, or zero?
// Text not supported yet.
// Here is how the sections apply to various values in Excel:
// 1 section: [POSITIVE/NEGATIVE/ZERO/TEXT]
// 2 sections: [POSITIVE/ZERO/TEXT] [NEGATIVE]
// 3 sections: [POSITIVE/TEXT] [NEGATIVE] [ZERO]
// 4 sections: [POSITIVE] [NEGATIVE] [ZERO] [TEXT]
switch (count($sections)) {
case 1:
$format = $sections[0];
break;
if (preg_match("/^[hmsdy]/i", $format)) { // custom datetime format
case 2:
$format = ($value >= 0) ? $sections[0] : $sections[1];
$value = abs($value); // Use the absolute value
break;
case 3:
$format = ($value > 0) ?
$sections[0] : ( ($value < 0) ?
$sections[1] : $sections[2]);
$value = abs($value); // Use the absolute value
break;
case 4:
$format = ($value > 0) ?
$sections[0] : ( ($value < 0) ?
$sections[1] : $sections[2]);
$value = abs($value); // Use the absolute value
break;
default:
// something is wrong, just use first section
$format = $sections[0];
break;
}
// Save format with color information for later use below
$formatColor = $format;
// Strip color information
$color_regex = '/^\\[[a-zA-Z]+\\]/';
$format = preg_replace($color_regex, '', $format);
// Let's begin inspecting the format and converting the value to a formatted string
if (preg_match('/^(\[\$[A-Z]*-[0-9A-F]*\])*[hmsdy]/i', $format)) { // datetime format
// dvc: convert Excel formats to PHP date formats
// first remove escapes related to non-format characters
// strip off first part containing e.g. [$-F800] or [$USD-409]
// general syntax: [$<Currency string>-<language info>]
// language info is in hexadecimal
$format = preg_replace('/^(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format);
// OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case
$format = strtolower($format);
$format = str_replace('\\', '', $format);
// 4-digit year
$format = str_replace('yyyy', 'Y', $format);
// 2-digit year
$format = str_replace('yy', 'y', $format);
// first letter of month - no php equivalent
$format = str_replace('mmmmm', 'M', $format);
// full month name
$format = str_replace('mmmm', 'F', $format);
// short month name
$format = str_replace('mmm', 'M', $format);
// mm is minutes if time or month w/leading zero
$format = str_replace(':mm', ':i', $format);
// tmp place holder
$format = str_replace('mm', 'x', $format);
// month no leading zero
$format = str_replace('m', 'n', $format);
// month leading zero
$format = str_replace('x', 'm', $format);
// 12-hour suffix
$format = str_replace('am/pm', 'A', $format);
// full day of week name
$format = str_replace('dddd', 'l', $format);
// short day of week name
$format = str_replace('ddd', 'D', $format);
// tmp place holder
$format = str_replace('dd', 'x', $format);
// days no leading zero
$format = str_replace('d', 'j', $format);
// days leading zero
$format = str_replace('x', 'd', $format);
// seconds
$format = str_replace('ss', 's', $format);
// fractional seconds - no php equivalent
$format = str_replace('.s', '', $format);
if (!strpos($format,'A')) { // 24-hour format
$format = str_replace('h', 'H', $format);
$format = strtr($format,self::$_dateFormatReplacements);
if (!strpos($format,'A')) { // 24-hour time format
$format = strtr($format,self::$_dateFormatReplacements24);
} else { // 12-hour time format
$format = strtr($format,self::$_dateFormatReplacements12);
}
return gmdate($format, PHPExcel_Shared_Date::ExcelToPHP($value));
$value = gmdate($format, PHPExcel_Shared_Date::ExcelToPHP($value));
} else if (preg_match('/%$/', $format)) { // % number format
if ($format === self::FORMAT_PERCENTAGE) {
return round( (100 * $value), 0) . '%';
}
if (preg_match('/\.[#0]+/i', $format, $m)) {
$s = substr($m[0], 0, 1) . (strlen($m[0]) - 1);
$format = str_replace($m[0], $s, $format);
}
if (preg_match('/^[#0]+/', $format, $m)) {
$format = str_replace($m[0], strlen($m[0]), $format);
}
$format = '%' . str_replace('%', 'f%%', $format);
$value = round( (100 * $value), 0) . '%';
} else {
if (preg_match('/\.[#0]+/i', $format, $m)) {
$s = substr($m[0], 0, 1) . (strlen($m[0]) - 1);
$format = str_replace($m[0], $s, $format);
}
if (preg_match('/^[#0]+/', $format, $m)) {
$format = str_replace($m[0], strlen($m[0]), $format);
}
$format = '%' . str_replace('%', 'f%%', $format);
return sprintf($format, 100 * $value);
$value = sprintf($format, 100 * $value);
}
} else {
if (preg_match ("/^([0-9.,-]+)$/", $value)) {
if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) {
return 'EUR ' . sprintf('%1.2f', $value);
$value = 'EUR ' . sprintf('%1.2f', $value);
} else {
// In Excel formats, "_" is used to add spacing, which we can't do in HTML
@@ -618,7 +643,8 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
$adjustedDecimalPart = $decimalPart/$GCD;
$adjustedDecimalDivisor = $decimalDivisor/$GCD;
if (strpos($format,'0') !== false) {
if ((strpos($format,'0') !== false) || (substr($format,0,3) == '? ?')) {
if ($integerPart == 0) { $integerPart = ''; }
$value = "$sign$integerPart $adjustedDecimalPart/$adjustedDecimalDivisor";
} else {
$adjustedDecimalPart += $integerPart * $adjustedDecimalDivisor;
@@ -633,12 +659,13 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
$dec = $matches[2];
$right = $matches[3];
if ($useThousands) {
$localeconv = localeconv();
if (($localeconv['thousands_sep'] == '') || ($localeconv['decimal_point'] == '')) {
$value = number_format($value, strlen($right), $localeconv['mon_decimal_point'], $localeconv['mon_thousands_sep']);
} else {
$value = number_format($value, strlen($right), $localeconv['decimal_point'], $localeconv['thousands_sep']);
}
$value = number_format(
$value
, strlen($right)
, PHPExcel_Shared_String::getDecimalSeparator()
, PHPExcel_Shared_String::getThousandsSeparator()
);
} else {
$sprintf_pattern = "%1." . strlen($right) . "f";
$value = sprintf($sprintf_pattern, $value);
@@ -646,13 +673,16 @@ class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
$value = preg_replace($number_regex, $value, $format);
}
}
return $value;
}
}
return $value;
}
// Additional formatting provided by callback function
if ($callBack !== null) {
list($writerInstance, $function) = $callBack;
$value = $writerInstance->$function($value, $formatColor);
}
return $value;
}
}

View File

@@ -2,7 +2,7 @@
/**
* PHPExcel
*
* Copyright (c) 2006 - 2009 PHPExcel
* Copyright (c) 2006 - 2010 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,7 @@
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.4.5, 2007-08-23
*/
@@ -43,7 +43,7 @@ require_once PHPEXCEL_ROOT . 'PHPExcel/IComparable.php';
*
* @category PHPExcel
* @package PHPExcel_Style
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
* @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Style_Protection implements PHPExcel_IComparable
{
@@ -149,9 +149,9 @@ class PHPExcel_Style_Protection implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXSelectedCells()
public function getSelectedCells()
{
return $this->getActiveSheet()->getXSelectedCells();
return $this->getActiveSheet()->getSelectedCells();
}
/**
@@ -160,9 +160,9 @@ class PHPExcel_Style_Protection implements PHPExcel_IComparable
*
* @return string E.g. 'A1'
*/
public function getXActiveCell()
public function getActiveCell()
{
return $this->getActiveSheet()->getXActiveCell();
return $this->getActiveSheet()->getActiveCell();
}
/**
@@ -190,7 +190,7 @@ class PHPExcel_Style_Protection implements PHPExcel_IComparable
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
if ($this->_isSupervisor) {
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
if (array_key_exists('locked', $pStyles)) {
$this->setLocked($pStyles['locked']);
@@ -226,7 +226,7 @@ class PHPExcel_Style_Protection implements PHPExcel_IComparable
public function setLocked($pValue = self::PROTECTION_INHERIT) {
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('locked' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_locked = $pValue;
}
@@ -254,7 +254,7 @@ class PHPExcel_Style_Protection implements PHPExcel_IComparable
public function setHidden($pValue = self::PROTECTION_INHERIT) {
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('hidden' => $pValue));
$this->getActiveSheet()->getStyle($this->getXSelectedCells())->applyFromArray($styleArray);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->_hidden = $pValue;
}
@@ -277,37 +277,6 @@ class PHPExcel_Style_Protection implements PHPExcel_IComparable
);
}
/**
* Hash index
*
* @var string
*/
private $_hashIndex;
/**
* Get hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @return string Hash index
*/
public function getHashIndex() {
return $this->_hashIndex;
}
/**
* Set hash index
*
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
*
* @param string $value Hash index
*/
public function setHashIndex($value) {
$this->_hashIndex = $value;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/