Getting close to the end of all this psr-2 goodness now, and beginning to think about splitting to a 1.8 branch and a 1.9 branch, with the 1.9 branch having a minimum PHP version of 5.4, so we can begin improving the code, starting with namespacing and a simple bootstrap for those who don't use composer

This commit is contained in:
MarkBaker 2015-05-18 16:39:04 +01:00
parent 066a85d3d2
commit 4648e386f5
53 changed files with 984 additions and 1095 deletions

View File

@ -2063,7 +2063,7 @@ class PHPExcel_Calculation
private static $controlFunctions = array( private static $controlFunctions = array(
'MKMATRIX' => array( 'MKMATRIX' => array(
'argumentCount' => '*', 'argumentCount' => '*',
'functionCall' => 'self::_mkMatrix' 'functionCall' => 'self::mkMatrix'
) )
); );
@ -2542,7 +2542,7 @@ class PHPExcel_Calculation
* @param mixed $value * @param mixed $value
* @return mixed * @return mixed
*/ */
public static function _wrapResult($value) public static function wrapResult($value)
{ {
if (is_string($value)) { if (is_string($value)) {
// Error values cannot be "wrapped" // Error values cannot be "wrapped"
@ -2567,7 +2567,7 @@ class PHPExcel_Calculation
* @param mixed $value * @param mixed $value
* @return mixed * @return mixed
*/ */
public static function _unwrapResult($value) public static function unwrapResult($value)
{ {
if (is_string($value)) { if (is_string($value)) {
if ((isset($value{0})) && ($value{0} == '"') && (substr($value, -1) == '"')) { if ((isset($value{0})) && ($value{0} == '"') && (substr($value, -1) == '"')) {
@ -2634,7 +2634,7 @@ class PHPExcel_Calculation
'cell' => $pCell->getCoordinate(), 'cell' => $pCell->getCoordinate(),
); );
try { try {
$result = self::_unwrapResult($this->_calculateFormulaValue($pCell->getValue(), $pCell->getCoordinate(), $pCell)); $result = self::unwrapResult($this->_calculateFormulaValue($pCell->getValue(), $pCell->getCoordinate(), $pCell));
$cellAddress = array_pop($this->cellStack); $cellAddress = array_pop($this->cellStack);
$this->workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']); $this->workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']);
} catch (PHPExcel_Exception $e) { } catch (PHPExcel_Exception $e) {
@ -2726,7 +2726,7 @@ class PHPExcel_Calculation
$this->calculationCacheEnabled = false; $this->calculationCacheEnabled = false;
// Execute the calculation // Execute the calculation
try { try {
$result = self::_unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell)); $result = self::unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell));
} catch (PHPExcel_Exception $e) { } catch (PHPExcel_Exception $e) {
throw new PHPExcel_Calculation_Exception($e->getMessage()); throw new PHPExcel_Calculation_Exception($e->getMessage());
} }
@ -2776,11 +2776,11 @@ class PHPExcel_Calculation
// We simply return the cell value if not // We simply return the cell value if not
$formula = trim($formula); $formula = trim($formula);
if ($formula{0} != '=') { if ($formula{0} != '=') {
return self::_wrapResult($formula); return self::wrapResult($formula);
} }
$formula = ltrim(substr($formula, 1)); $formula = ltrim(substr($formula, 1));
if (!isset($formula{0})) { if (!isset($formula{0})) {
return self::_wrapResult($formula); return self::wrapResult($formula);
} }
$pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null; $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null;
@ -2811,7 +2811,7 @@ class PHPExcel_Calculation
// Parse the formula onto the token stack and calculate the value // Parse the formula onto the token stack and calculate the value
$this->cyclicReferenceStack->push($wsCellReference); $this->cyclicReferenceStack->push($wsCellReference);
$cellValue = $this->_processTokenStack($this->_parseFormula($formula, $pCell), $cellID, $pCell); $cellValue = $this->processTokenStack($this->_parseFormula($formula, $pCell), $cellID, $pCell);
$this->cyclicReferenceStack->pop(); $this->cyclicReferenceStack->pop();
// Save to calculation cache // Save to calculation cache
@ -3108,7 +3108,7 @@ class PHPExcel_Calculation
} }
private static function _mkMatrix() private static function mkMatrix()
{ {
return func_get_args(); return func_get_args();
} }
@ -3416,7 +3416,7 @@ class PHPExcel_Calculation
if ($opCharacter == '"') { if ($opCharacter == '"') {
// echo 'Element is a String<br />'; // echo 'Element is a String<br />';
// UnEscape any quotes within the string // UnEscape any quotes within the string
$val = self::_wrapResult(str_replace('""', '"', self::_unwrapResult($val))); $val = self::wrapResult(str_replace('""', '"', self::unwrapResult($val)));
} elseif (is_numeric($val)) { } elseif (is_numeric($val)) {
// echo 'Element is a Number<br />'; // echo 'Element is a Number<br />';
if ((strpos($val, '.') !== false) || (stripos($val, 'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) { if ((strpos($val, '.') !== false) || (stripos($val, 'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) {
@ -3519,7 +3519,7 @@ class PHPExcel_Calculation
} }
// evaluate postfix notation // evaluate postfix notation
private function _processTokenStack($tokens, $cellID = null, PHPExcel_Cell $pCell = null) private function processTokenStack($tokens, $cellID = null, PHPExcel_Cell $pCell = null)
{ {
if ($tokens == false) { if ($tokens == false) {
return false; return false;
@ -3659,7 +3659,7 @@ class PHPExcel_Calculation
$result = '#VALUE!'; $result = '#VALUE!';
} }
} else { } else {
$result = '"'.str_replace('""', '"', self::_unwrapResult($operand1, '"').self::_unwrapResult($operand2, '"')).'"'; $result = '"'.str_replace('""', '"', self::unwrapResult($operand1, '"').self::unwrapResult($operand2, '"')).'"';
} }
$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result)); $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
$stack->push('Value', $result); $stack->push('Value', $result);
@ -3832,7 +3832,7 @@ class PHPExcel_Calculation
} }
} }
} else { } else {
$args[] = self::_unwrapResult($arg['value']); $args[] = self::unwrapResult($arg['value']);
if ($functionName != 'MKMATRIX') { if ($functionName != 'MKMATRIX') {
$argArrayVals[] = $this->showValue($arg['value']); $argArrayVals[] = $this->showValue($arg['value']);
} }
@ -3892,7 +3892,7 @@ class PHPExcel_Calculation
if ($functionName != 'MKMATRIX') { if ($functionName != 'MKMATRIX') {
$this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($result)); $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($result));
} }
$stack->push('Value', self::_wrapResult($result)); $stack->push('Value', self::wrapResult($result));
} }
} else { } else {
@ -3948,7 +3948,7 @@ class PHPExcel_Calculation
// We only need special validations for the operand if it is a string // We only need special validations for the operand if it is a string
// Start by stripping off the quotation marks we use to identify true excel string values internally // Start by stripping off the quotation marks we use to identify true excel string values internally
if ($operand > '' && $operand{0} == '"') { if ($operand > '' && $operand{0} == '"') {
$operand = self::_unwrapResult($operand); $operand = self::unwrapResult($operand);
} }
// If the string is a numeric value, we treat it as a numeric, so no further testing // If the string is a numeric value, we treat it as a numeric, so no further testing
if (!is_numeric($operand)) { if (!is_numeric($operand)) {
@ -4010,10 +4010,10 @@ class PHPExcel_Calculation
// Simple validate the two operands if they are string values // Simple validate the two operands if they are string values
if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') { if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') {
$operand1 = self::_unwrapResult($operand1); $operand1 = self::unwrapResult($operand1);
} }
if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') { if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') {
$operand2 = self::_unwrapResult($operand2); $operand2 = self::unwrapResult($operand2);
} }
// Use case insensitive comparaison if not OpenOffice mode // Use case insensitive comparaison if not OpenOffice mode

View File

@ -126,7 +126,7 @@ class PHPExcel_Calculation_Database
$k = array_search($criteriaName, $fieldNames); $k = array_search($criteriaName, $fieldNames);
if (isset($dataValues[$k])) { if (isset($dataValues[$k])) {
$dataValue = $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); $testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList);
} }
} }

View File

@ -323,7 +323,7 @@ class PHPExcel_Calculation_Functions
} }
if (!in_array($condition{0}, array('>', '<', '='))) { if (!in_array($condition{0}, array('>', '<', '='))) {
if (!is_numeric($condition)) { if (!is_numeric($condition)) {
$condition = PHPExcel_Calculation::_wrapResult(strtoupper($condition)); $condition = PHPExcel_Calculation::wrapResult(strtoupper($condition));
} }
return '=' . $condition; return '=' . $condition;
} else { } else {
@ -332,7 +332,7 @@ class PHPExcel_Calculation_Functions
if (!is_numeric($operand)) { if (!is_numeric($operand)) {
$operand = str_replace('"', '""', $operand); $operand = str_replace('"', '""', $operand);
$operand = PHPExcel_Calculation::_wrapResult(strtoupper($operand)); $operand = PHPExcel_Calculation::wrapResult(strtoupper($operand));
} }
return $operator.$operand; return $operator.$operand;

View File

@ -1206,7 +1206,7 @@ class PHPExcel_Calculation_MathTrig
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = str_replace('"', '""', $arg); $arg = str_replace('"', '""', $arg);
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;

View File

@ -877,7 +877,7 @@ class PHPExcel_Calculation_Statistical
$aCount = 0; $aCount = 0;
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
@ -1298,7 +1298,7 @@ class PHPExcel_Calculation_Statistical
// Loop through arguments // Loop through arguments
foreach ($aArgs as $arg) { foreach ($aArgs as $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
@ -2290,7 +2290,7 @@ class PHPExcel_Calculation_Statistical
// Loop through arguments // Loop through arguments
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
@ -2449,7 +2449,7 @@ class PHPExcel_Calculation_Statistical
// Loop through arguments // Loop through arguments
foreach ($aArgs as $key => $arg) { foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) { if (!is_numeric($arg)) {
$arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
} }
$testCondition = '='.$arg.$condition; $testCondition = '='.$arg.$condition;
if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {

View File

@ -32,7 +32,7 @@ class PHPExcel_Chart
* *
* @var string * @var string
*/ */
private $_name = ''; private $name = '';
/** /**
* Worksheet * Worksheet
@ -171,7 +171,7 @@ class PHPExcel_Chart
*/ */
public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null) public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null)
{ {
$this->_name = $name; $this->name = $name;
$this->title = $title; $this->title = $title;
$this->legend = $legend; $this->legend = $legend;
$this->xAxisLabel = $xAxisLabel; $this->xAxisLabel = $xAxisLabel;
@ -192,7 +192,7 @@ class PHPExcel_Chart
*/ */
public function getName() public function getName()
{ {
return $this->_name; return $this->name;
} }
/** /**

View File

@ -288,7 +288,7 @@ class PHPExcel_Chart_DataSeriesValues
{ {
if ($this->dataSource !== null) { if ($this->dataSource !== null) {
$calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent()); $calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent());
$newDataValues = PHPExcel_Calculation::_unwrapResult( $newDataValues = PHPExcel_Calculation::unwrapResult(
$calcEngine->_calculateFormulaValue( $calcEngine->_calculateFormulaValue(
'='.$this->dataSource, '='.$this->dataSource,
null, null,

View File

@ -43,7 +43,7 @@ class PHPExcel_IOFactory
* @access private * @access private
* @static * @static
*/ */
private static $_searchLocations = array( private static $searchLocations = array(
array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ), array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ),
array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' ) array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' )
); );
@ -55,7 +55,7 @@ class PHPExcel_IOFactory
* @access private * @access private
* @static * @static
*/ */
private static $_autoResolveClasses = array( private static $autoResolveClasses = array(
'Excel2007', 'Excel2007',
'Excel5', 'Excel5',
'Excel2003XML', 'Excel2003XML',
@ -82,7 +82,7 @@ class PHPExcel_IOFactory
*/ */
public static function getSearchLocations() public static function getSearchLocations()
{ {
return self::$_searchLocations; return self::$searchLocations;
} }
/** /**
@ -96,7 +96,7 @@ class PHPExcel_IOFactory
public static function setSearchLocations($value) public static function setSearchLocations($value)
{ {
if (is_array($value)) { if (is_array($value)) {
self::$_searchLocations = $value; self::$searchLocations = $value;
} else { } else {
throw new PHPExcel_Reader_Exception('Invalid parameter passed.'); throw new PHPExcel_Reader_Exception('Invalid parameter passed.');
} }
@ -113,7 +113,7 @@ class PHPExcel_IOFactory
*/ */
public static function addSearchLocation($type = '', $location = '', $classname = '') 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'; $searchType = 'IWriter';
// Include class // Include class
foreach (self::$_searchLocations as $searchLocation) { foreach (self::$searchLocations as $searchLocation) {
if ($searchLocation['type'] == $searchType) { if ($searchLocation['type'] == $searchType) {
$className = str_replace('{0}', $writerType, $searchLocation['class']); $className = str_replace('{0}', $writerType, $searchLocation['class']);
@ -162,7 +162,7 @@ class PHPExcel_IOFactory
$searchType = 'IReader'; $searchType = 'IReader';
// Include class // Include class
foreach (self::$_searchLocations as $searchLocation) { foreach (self::$searchLocations as $searchLocation) {
if ($searchLocation['type'] == $searchType) { if ($searchLocation['type'] == $searchType) {
$className = str_replace('{0}', $readerType, $searchLocation['class']); $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 // If we reach here then "lucky guess" didn't give any result
// Try walking through all the options in self::$_autoResolveClasses // Try walking through all the options in self::$autoResolveClasses
foreach (self::$_autoResolveClasses as $autoResolveClass) { foreach (self::$autoResolveClasses as $autoResolveClass) {
// Ignore our original guess, we know that won't work // Ignore our original guess, we know that won't work
if ($autoResolveClass !== $extensionType) { if ($autoResolveClass !== $extensionType) {
$reader = self::createReader($autoResolveClass); $reader = self::createReader($autoResolveClass);

View File

@ -32,35 +32,35 @@ class PHPExcel_NamedRange
* *
* @var string * @var string
*/ */
private $_name; private $name;
/** /**
* Worksheet on which the named range can be resolved * Worksheet on which the named range can be resolved
* *
* @var PHPExcel_Worksheet * @var PHPExcel_Worksheet
*/ */
private $_worksheet; private $worksheet;
/** /**
* Range of the referenced cells * Range of the referenced cells
* *
* @var string * @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 * @var bool
*/ */
private $_localOnly; private $localOnly;
/** /**
* Scope * Scope
* *
* @var PHPExcel_Worksheet * @var PHPExcel_Worksheet
*/ */
private $_scope; private $scope;
/** /**
* Create a new NamedRange * Create a new NamedRange
@ -80,12 +80,11 @@ class PHPExcel_NamedRange
} }
// Set local members // Set local members
$this->_name = $pName; $this->name = $pName;
$this->_worksheet = $pWorksheet; $this->worksheet = $pWorksheet;
$this->_range = $pRange; $this->range = $pRange;
$this->_localOnly = $pLocalOnly; $this->localOnly = $pLocalOnly;
$this->_scope = ($pLocalOnly == true) ? $this->scope = ($pLocalOnly == true) ? (($pScope == null) ? $pWorksheet : $pScope) : null;
(($pScope == null) ? $pWorksheet : $pScope) : null;
} }
/** /**
@ -95,7 +94,7 @@ class PHPExcel_NamedRange
*/ */
public function getName() public function getName()
{ {
return $this->_name; return $this->name;
} }
/** /**
@ -108,21 +107,21 @@ class PHPExcel_NamedRange
{ {
if ($value !== null) { if ($value !== null) {
// Old title // Old title
$oldTitle = $this->_name; $oldTitle = $this->name;
// Re-attach // Re-attach
if ($this->_worksheet !== null) { if ($this->worksheet !== null) {
$this->_worksheet->getParent()->removeNamedRange($this->_name, $this->_worksheet); $this->worksheet->getParent()->removeNamedRange($this->name, $this->worksheet);
} }
$this->_name = $value; $this->name = $value;
if ($this->_worksheet !== null) { if ($this->worksheet !== null) {
$this->_worksheet->getParent()->addNamedRange($this); $this->worksheet->getParent()->addNamedRange($this);
} }
// New title // New title
$newTitle = $this->_name; $newTitle = $this->name;
PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle); PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->worksheet->getParent(), $oldTitle, $newTitle);
} }
return $this; return $this;
} }
@ -134,7 +133,7 @@ class PHPExcel_NamedRange
*/ */
public function getWorksheet() public function getWorksheet()
{ {
return $this->_worksheet; return $this->worksheet;
} }
/** /**
@ -146,7 +145,7 @@ class PHPExcel_NamedRange
public function setWorksheet(PHPExcel_Worksheet $value = null) public function setWorksheet(PHPExcel_Worksheet $value = null)
{ {
if ($value !== null) { if ($value !== null) {
$this->_worksheet = $value; $this->worksheet = $value;
} }
return $this; return $this;
} }
@ -158,7 +157,7 @@ class PHPExcel_NamedRange
*/ */
public function getRange() public function getRange()
{ {
return $this->_range; return $this->range;
} }
/** /**
@ -170,7 +169,7 @@ class PHPExcel_NamedRange
public function setRange($value = null) public function setRange($value = null)
{ {
if ($value !== null) { if ($value !== null) {
$this->_range = $value; $this->range = $value;
} }
return $this; return $this;
} }
@ -182,7 +181,7 @@ class PHPExcel_NamedRange
*/ */
public function getLocalOnly() public function getLocalOnly()
{ {
return $this->_localOnly; return $this->localOnly;
} }
/** /**
@ -193,8 +192,8 @@ class PHPExcel_NamedRange
*/ */
public function setLocalOnly($value = false) public function setLocalOnly($value = false)
{ {
$this->_localOnly = $value; $this->localOnly = $value;
$this->_scope = $value ? $this->_worksheet : null; $this->scope = $value ? $this->worksheet : null;
return $this; return $this;
} }
@ -205,7 +204,7 @@ class PHPExcel_NamedRange
*/ */
public function getScope() public function getScope()
{ {
return $this->_scope; return $this->scope;
} }
/** /**
@ -216,8 +215,8 @@ class PHPExcel_NamedRange
*/ */
public function setScope(PHPExcel_Worksheet $value = null) public function setScope(PHPExcel_Worksheet $value = null)
{ {
$this->_scope = $value; $this->scope = $value;
$this->_localOnly = ($value == null) ? false : true; $this->localOnly = ($value == null) ? false : true;
return $this; return $this;
} }

View File

@ -50,7 +50,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* @access private * @access private
* @var string * @var string
*/ */
private $_inputEncoding = 'UTF-8'; private $inputEncoding = 'UTF-8';
/** /**
* Delimiter * Delimiter
@ -58,7 +58,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* @access private * @access private
* @var string * @var string
*/ */
private $_delimiter = ','; private $delimiter = ',';
/** /**
* Enclosure * Enclosure
@ -66,7 +66,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* @access private * @access private
* @var string * @var string
*/ */
private $_enclosure = '"'; private $enclosure = '"';
/** /**
* Sheet index to read * Sheet index to read
@ -74,7 +74,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* @access private * @access private
* @var int * @var int
*/ */
private $_sheetIndex = 0; private $sheetIndex = 0;
/** /**
* Load rows contiguously * Load rows contiguously
@ -82,14 +82,14 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
* @access private * @access private
* @var int * @var int
*/ */
private $_contiguous = false; private $contiguous = false;
/** /**
* Row counter for loading rows contiguously * Row counter for loading rows contiguously
* *
* @var int * @var int
*/ */
private $_contiguousRow = -1; private $contiguousRow = -1;
/** /**
@ -117,7 +117,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function setInputEncoding($pValue = 'UTF-8') public function setInputEncoding($pValue = 'UTF-8')
{ {
$this->_inputEncoding = $pValue; $this->inputEncoding = $pValue;
return $this; return $this;
} }
@ -128,7 +128,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function getInputEncoding() public function getInputEncoding()
{ {
return $this->_inputEncoding; return $this->inputEncoding;
} }
/** /**
@ -139,7 +139,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
{ {
rewind($this->_fileHandle); rewind($this->_fileHandle);
switch ($this->_inputEncoding) { switch ($this->inputEncoding) {
case 'UTF-8': case 'UTF-8':
fgets($this->_fileHandle, 4) == "\xEF\xBB\xBF" ? fgets($this->_fileHandle, 4) == "\xEF\xBB\xBF" ?
fseek($this->_fileHandle, 3) : fseek($this->_fileHandle, 0); fseek($this->_fileHandle, 3) : fseek($this->_fileHandle, 0);
@ -184,7 +184,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
// Skip BOM, if any // Skip BOM, if any
$this->_skipBOM(); $this->_skipBOM();
$escapeEnclosures = array( "\\" . $this->_enclosure, $this->_enclosure . $this->_enclosure ); $escapeEnclosures = array( "\\" . $this->enclosure, $this->enclosure . $this->enclosure );
$worksheetInfo = array(); $worksheetInfo = array();
$worksheetInfo[0]['worksheetName'] = 'Worksheet'; $worksheetInfo[0]['worksheetName'] = 'Worksheet';
@ -194,7 +194,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
$worksheetInfo[0]['totalColumns'] = 0; $worksheetInfo[0]['totalColumns'] = 0;
// Loop through each line of the file in turn // 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]['totalRows']++;
$worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1); $worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1);
} }
@ -249,32 +249,32 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
$this->_skipBOM(); $this->_skipBOM();
// Create new PHPExcel object // Create new PHPExcel object
while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) { while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet(); $objPHPExcel->createSheet();
} }
$sheet = $objPHPExcel->setActiveSheetIndex($this->_sheetIndex); $sheet = $objPHPExcel->setActiveSheetIndex($this->sheetIndex);
$escapeEnclosures = array( "\\" . $this->_enclosure, $escapeEnclosures = array( "\\" . $this->enclosure,
$this->_enclosure . $this->_enclosure $this->enclosure . $this->enclosure
); );
// Set our starting row based on whether we're in contiguous mode or not // Set our starting row based on whether we're in contiguous mode or not
$currentRow = 1; $currentRow = 1;
if ($this->_contiguous) { if ($this->contiguous) {
$currentRow = ($this->_contiguousRow == -1) ? $sheet->getHighestRow(): $this->_contiguousRow; $currentRow = ($this->contiguousRow == -1) ? $sheet->getHighestRow(): $this->contiguousRow;
} }
// Loop through each line of the file in turn // 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'; $columnLetter = 'A';
foreach ($rowData as $rowDatum) { foreach ($rowData as $rowDatum) {
if ($rowDatum != '' && $this->_readFilter->readCell($columnLetter, $currentRow)) { if ($rowDatum != '' && $this->_readFilter->readCell($columnLetter, $currentRow)) {
// Unescape enclosures // Unescape enclosures
$rowDatum = str_replace($escapeEnclosures, $this->_enclosure, $rowDatum); $rowDatum = str_replace($escapeEnclosures, $this->enclosure, $rowDatum);
// Convert encoding if necessary // Convert encoding if necessary
if ($this->_inputEncoding !== 'UTF-8') { if ($this->inputEncoding !== 'UTF-8') {
$rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->_inputEncoding); $rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->inputEncoding);
} }
// Set cell value // Set cell value
@ -288,8 +288,8 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
// Close file // Close file
fclose($fileHandle); fclose($fileHandle);
if ($this->_contiguous) { if ($this->contiguous) {
$this->_contiguousRow = $currentRow; $this->contiguousRow = $currentRow;
} }
ini_set('auto_detect_line_endings', $lineEnding); ini_set('auto_detect_line_endings', $lineEnding);
@ -305,7 +305,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function getDelimiter() public function getDelimiter()
{ {
return $this->_delimiter; return $this->delimiter;
} }
/** /**
@ -316,7 +316,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function setDelimiter($pValue = ',') public function setDelimiter($pValue = ',')
{ {
$this->_delimiter = $pValue; $this->delimiter = $pValue;
return $this; return $this;
} }
@ -327,7 +327,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function getEnclosure() public function getEnclosure()
{ {
return $this->_enclosure; return $this->enclosure;
} }
/** /**
@ -341,7 +341,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
if ($pValue == '') { if ($pValue == '') {
$pValue = '"'; $pValue = '"';
} }
$this->_enclosure = $pValue; $this->enclosure = $pValue;
return $this; return $this;
} }
@ -352,7 +352,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function getSheetIndex() public function getSheetIndex()
{ {
return $this->_sheetIndex; return $this->sheetIndex;
} }
/** /**
@ -363,7 +363,7 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function setSheetIndex($pValue = 0) public function setSheetIndex($pValue = 0)
{ {
$this->_sheetIndex = $pValue; $this->sheetIndex = $pValue;
return $this; return $this;
} }
@ -374,9 +374,9 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function setContiguous($contiguous = false) public function setContiguous($contiguous = false)
{ {
$this->_contiguous = (bool) $contiguous; $this->contiguous = (bool) $contiguous;
if (!$contiguous) { if (!$contiguous) {
$this->_contiguousRow = -1; $this->contiguousRow = -1;
} }
return $this; return $this;
@ -389,6 +389,6 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*/ */
public function getContiguous() public function getContiguous()
{ {
return $this->_contiguous; return $this->contiguous;
} }
} }

View File

@ -1,6 +1,16 @@
<?php <?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel * PHPExcel_Reader_Excel2003XML
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,24 +34,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/** PHPExcel 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 class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
{ {
/** /**
@ -49,14 +41,14 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
* *
* @var array * @var array
*/ */
protected $_styles = array(); protected $styles = array();
/** /**
* Character set used in the file * Character set used in the file
* *
* @var string * @var string
*/ */
protected $_charSet = 'UTF-8'; protected $charSet = 'UTF-8';
/** /**
* Create a new PHPExcel_Reader_Excel2003XML * Create a new PHPExcel_Reader_Excel2003XML
@ -111,9 +103,9 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
// Retrieve charset encoding // Retrieve charset encoding
if (preg_match('/<?xml.*encoding=[\'"](.*?)[\'"].*?>/um', $data, $matches)) { 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; return $valid;
} }
@ -143,7 +135,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
$xml_ss = $xml->children($namespaces['ss']); $xml_ss = $xml->children($namespaces['ss']);
foreach ($xml_ss->Worksheet as $worksheet) { foreach ($xml_ss->Worksheet as $worksheet) {
$worksheet_ss = $worksheet->attributes($namespaces['ss']); $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; return $worksheetNames;
@ -337,39 +329,39 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) { foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) {
switch ($propertyName) { switch ($propertyName) {
case 'Title': case 'Title':
$docProps->setTitle(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setTitle(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'Subject': case 'Subject':
$docProps->setSubject(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setSubject(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'Author': case 'Author':
$docProps->setCreator(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setCreator(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'Created': case 'Created':
$creationDate = strtotime($propertyValue); $creationDate = strtotime($propertyValue);
$docProps->setCreated($creationDate); $docProps->setCreated($creationDate);
break; break;
case 'LastAuthor': case 'LastAuthor':
$docProps->setLastModifiedBy(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setLastModifiedBy(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'LastSaved': case 'LastSaved':
$lastSaveDate = strtotime($propertyValue); $lastSaveDate = strtotime($propertyValue);
$docProps->setModified($lastSaveDate); $docProps->setModified($lastSaveDate);
break; break;
case 'Company': case 'Company':
$docProps->setCompany(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setCompany(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'Category': case 'Category':
$docProps->setCategory(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setCategory(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'Manager': case 'Manager':
$docProps->setManager(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setManager(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'Keywords': case 'Keywords':
$docProps->setKeywords(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setKeywords(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
case 'Description': case 'Description':
$docProps->setDescription(self::_convertStringEncoding($propertyValue, $this->_charSet)); $docProps->setDescription(self::_convertStringEncoding($propertyValue, $this->charSet));
break; break;
} }
} }
@ -410,9 +402,9 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
$styleID = (string) $style_ss['ID']; $styleID = (string) $style_ss['ID'];
// echo 'Style ID = '.$styleID.'<br />'; // echo 'Style ID = '.$styleID.'<br />';
if ($styleID == 'Default') { if ($styleID == 'Default') {
$this->_styles['Default'] = array(); $this->styles['Default'] = array();
} else { } else {
$this->_styles[$styleID] = $this->_styles['Default']; $this->styles[$styleID] = $this->styles['Default'];
} }
foreach ($style as $styleType => $styleData) { foreach ($style as $styleType => $styleData) {
$styleAttributes = $styleData->attributes($namespaces['ss']); $styleAttributes = $styleData->attributes($namespaces['ss']);
@ -425,16 +417,16 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
switch ($styleAttributeKey) { switch ($styleAttributeKey) {
case 'Vertical': case 'Vertical':
if (self::identifyFixedStyleValue($verticalAlignmentStyles, $styleAttributeValue)) { if (self::identifyFixedStyleValue($verticalAlignmentStyles, $styleAttributeValue)) {
$this->_styles[$styleID]['alignment']['vertical'] = $styleAttributeValue; $this->styles[$styleID]['alignment']['vertical'] = $styleAttributeValue;
} }
break; break;
case 'Horizontal': case 'Horizontal':
if (self::identifyFixedStyleValue($horizontalAlignmentStyles, $styleAttributeValue)) { if (self::identifyFixedStyleValue($horizontalAlignmentStyles, $styleAttributeValue)) {
$this->_styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue; $this->styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue;
} }
break; break;
case 'WrapText': case 'WrapText':
$this->_styles[$styleID]['alignment']['wrap'] = true; $this->styles[$styleID]['alignment']['wrap'] = true;
break; break;
} }
} }
@ -464,7 +456,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
} }
if (!empty($thisBorder)) { if (!empty($thisBorder)) {
if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) { if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) {
$this->_styles[$styleID]['borders'][$borderPosition] = $thisBorder; $this->styles[$styleID]['borders'][$borderPosition] = $thisBorder;
} }
} }
} }
@ -475,23 +467,23 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
$styleAttributeValue = (string) $styleAttributeValue; $styleAttributeValue = (string) $styleAttributeValue;
switch ($styleAttributeKey) { switch ($styleAttributeKey) {
case 'FontName': case 'FontName':
$this->_styles[$styleID]['font']['name'] = $styleAttributeValue; $this->styles[$styleID]['font']['name'] = $styleAttributeValue;
break; break;
case 'Size': case 'Size':
$this->_styles[$styleID]['font']['size'] = $styleAttributeValue; $this->styles[$styleID]['font']['size'] = $styleAttributeValue;
break; break;
case 'Color': case 'Color':
$this->_styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue, 1); $this->styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue, 1);
break; break;
case 'Bold': case 'Bold':
$this->_styles[$styleID]['font']['bold'] = true; $this->styles[$styleID]['font']['bold'] = true;
break; break;
case 'Italic': case 'Italic':
$this->_styles[$styleID]['font']['italic'] = true; $this->styles[$styleID]['font']['italic'] = true;
break; break;
case 'Underline': case 'Underline':
if (self::identifyFixedStyleValue($underlineStyles, $styleAttributeValue)) { if (self::identifyFixedStyleValue($underlineStyles, $styleAttributeValue)) {
$this->_styles[$styleID]['font']['underline'] = $styleAttributeValue; $this->styles[$styleID]['font']['underline'] = $styleAttributeValue;
} }
break; break;
} }
@ -502,7 +494,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
// echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />'; // echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
switch ($styleAttributeKey) { switch ($styleAttributeKey) {
case 'Color': case 'Color':
$this->_styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue, 1); $this->styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue, 1);
break; break;
} }
} }
@ -517,7 +509,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
break; break;
} }
if ($styleAttributeValue > '') { if ($styleAttributeValue > '') {
$this->_styles[$styleID]['numberformat']['code'] = $styleAttributeValue; $this->styles[$styleID]['numberformat']['code'] = $styleAttributeValue;
} }
} }
break; break;
@ -528,7 +520,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
break; break;
} }
} }
// print_r($this->_styles[$styleID]); // print_r($this->styles[$styleID]);
// echo '<hr />'; // echo '<hr />';
} }
// echo '<hr />'; // echo '<hr />';
@ -550,7 +542,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
$objPHPExcel->createSheet(); $objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($worksheetID); $objPHPExcel->setActiveSheetIndex($worksheetID);
if (isset($worksheet_ss['Name'])) { 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 // 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 // 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 // the worksheet name in line with the formula, not the reverse
@ -640,7 +632,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
const TYPE_ERROR = 'e'; const TYPE_ERROR = 'e';
*/ */
case 'String': case 'String':
$cellValue = self::_convertStringEncoding($cellValue, $this->_charSet); $cellValue = self::_convertStringEncoding($cellValue, $this->charSet);
$type = PHPExcel_Cell_DataType::TYPE_STRING; $type = PHPExcel_Cell_DataType::TYPE_STRING;
break; break;
case 'Number': case 'Number':
@ -748,20 +740,20 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
// echo $annotation,'<br />'; // echo $annotation,'<br />';
$annotation = strip_tags($node); $annotation = strip_tags($node);
// echo 'Annotation: ', $annotation,'<br />'; // 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']))) { if (($cellIsSet) && (isset($cell_ss['StyleID']))) {
$style = (string) $cell_ss['StyleID']; $style = (string) $cell_ss['StyleID'];
// echo 'Cell style for '.$columnID.$rowID.' is '.$style.'<br />'; // 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 />'; // echo 'Cell '.$columnID.$rowID.'<br />';
// print_r($this->_styles[$style]); // print_r($this->styles[$style]);
// echo '<br />'; // echo '<br />';
if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) { if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) {
$objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null); $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null);
} }
$objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->_styles[$style]); $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
} }
} }
++$columnID; ++$columnID;
@ -806,7 +798,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
{ {
$value = new PHPExcel_RichText(); $value = new PHPExcel_RichText();
$value->createText(self::_convertStringEncoding($is, $this->_charSet)); $value->createText(self::_convertStringEncoding($is, $this->charSet));
return $value; return $value;
} }

View File

@ -1,6 +1,16 @@
<?php <?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel * PHPExcel_Reader_Excel2007
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,24 +34,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/** PHPExcel 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 class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
{ {
/** /**
@ -49,14 +41,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
* *
* @var PHPExcel_ReferenceHelper * @var PHPExcel_ReferenceHelper
*/ */
private $_referenceHelper = null; private $referenceHelper = null;
/** /**
* PHPExcel_Reader_Excel2007_Theme instance * PHPExcel_Reader_Excel2007_Theme instance
* *
* @var PHPExcel_Reader_Excel2007_Theme * @var PHPExcel_Reader_Excel2007_Theme
*/ */
private static $_theme = null; private static $theme = null;
/** /**
* Create a new PHPExcel_Reader_Excel2007 instance * Create a new PHPExcel_Reader_Excel2007 instance
@ -64,7 +56,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
public function __construct() public function __construct()
{ {
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
$this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance(); $this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
} }
/** /**
@ -239,7 +231,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
return $worksheetInfo; return $worksheetInfo;
} }
private static function _castToBool($c) private static function castToBoolean($c)
{ {
// echo 'Initial Cast to Boolean', PHP_EOL; // echo 'Initial Cast to Boolean', PHP_EOL;
$value = isset($c->v) ? (string) $c->v : null; $value = isset($c->v) ? (string) $c->v : null;
@ -251,21 +243,21 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
return (bool)$c->v; return (bool)$c->v;
} }
return $value; return $value;
} // function _castToBool() }
private static function _castToError($c) private static function castToError($c)
{ {
// echo 'Initial Cast to Error', PHP_EOL; // echo 'Initial Cast to Error', PHP_EOL;
return isset($c->v) ? (string) $c->v : null; return isset($c->v) ? (string) $c->v : null;
} // function _castToError() }
private static function _castToString($c) private static function castToString($c)
{ {
// echo 'Initial Cast to String, PHP_EOL; // echo 'Initial Cast to String, PHP_EOL;
return isset($c->v) ? (string) $c->v : null; return isset($c->v) ? (string) $c->v : null;
} // function _castToString() }
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 'Formula', PHP_EOL;
// echo '$c->f is ', $c->f, PHP_EOL; // echo '$c->f is ', $c->f, PHP_EOL;
@ -300,7 +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[0] = PHPExcel_Cell::columnIndexFromString($current[0]) - PHPExcel_Cell::columnIndexFromString($master[0]);
$difference[1] = $current[1] - $master[1]; $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; // echo 'Adjusted Formula is ', $value, PHP_EOL;
} }
} }
@ -384,7 +376,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
$themeColours[$themePos] = $xmlColourData['val']; $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; break;
} }
@ -445,7 +437,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
case "http://schemas.microsoft.com/office/2006/relationships/ui/extensibility": case "http://schemas.microsoft.com/office/2006/relationships/ui/extensibility":
$customUI = $rel['Target']; $customUI = $rel['Target'];
if (!is_null($customUI)) { if (!is_null($customUI)) {
$this->_readRibbon($excel, $customUI, $zip); $this->readRibbon($excel, $customUI, $zip);
} }
break; break;
case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
@ -461,7 +453,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
if (isset($val->t)) { if (isset($val->t)) {
$sharedStrings[] = PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $val->t); $sharedStrings[] = PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $val->t);
} elseif (isset($val->r)) { } elseif (isset($val->r)) {
$sharedStrings[] = $this->_parseRichText($val); $sharedStrings[] = $this->parseRichText($val);
} }
} }
} }
@ -540,7 +532,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
// add style to cellXf collection // add style to cellXf collection
$objStyle = new PHPExcel_Style; $objStyle = new PHPExcel_Style;
self::_readStyle($objStyle, $style); self::readStyle($objStyle, $style);
$excel->addCellXf($objStyle); $excel->addCellXf($objStyle);
} }
@ -550,7 +542,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
$tmpNumFmt = self::array_item($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); $tmpNumFmt = self::array_item($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
if (isset($tmpNumFmt["formatCode"])) { if (isset($tmpNumFmt["formatCode"])) {
$numFmt = (string) $tmpNumFmt["formatCode"]; $numFmt = (string) $tmpNumFmt["formatCode"];
} else if ((int)$xf["numFmtId"] < 165) { } elseif ((int)$xf["numFmtId"] < 165) {
$numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
} }
} }
@ -568,7 +560,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
// add style to cellStyleXf collection // add style to cellStyleXf collection
$objStyle = new PHPExcel_Style; $objStyle = new PHPExcel_Style;
self::_readStyle($objStyle, $cellStyle); self::readStyle($objStyle, $cellStyle);
$excel->addCellStyleXf($objStyle); $excel->addCellStyleXf($objStyle);
} }
} }
@ -579,7 +571,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
if ($xmlStyles->dxfs) { if ($xmlStyles->dxfs) {
foreach ($xmlStyles->dxfs->dxf as $dxf) { foreach ($xmlStyles->dxfs->dxf as $dxf) {
$style = new PHPExcel_Style(false, true); $style = new PHPExcel_Style(false, true);
self::_readStyle($style, $dxf); self::readStyle($style, $dxf);
$dxfs[] = $style; $dxfs[] = $style;
} }
} }
@ -590,7 +582,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
if (isset($cellStyles[intval($cellStyle['xfId'])])) { if (isset($cellStyles[intval($cellStyle['xfId'])])) {
// Set default style // Set default style
$style = new PHPExcel_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 // normal style, currently not using it for anything
} }
@ -843,10 +835,10 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
case "b": case "b":
// echo 'Boolean', PHP_EOL; // echo 'Boolean', PHP_EOL;
if (!isset($c->f)) { if (!isset($c->f)) {
$value = self::_castToBool($c); $value = self::castToBoolean($c);
} else { } else {
// Formula // Formula
$this->_castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, '_castToBool'); $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToBoolean');
if (isset($c->f['t'])) { if (isset($c->f['t'])) {
$att = array(); $att = array();
$att = $c->f; $att = $c->f;
@ -857,15 +849,15 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
break; break;
case "inlineStr": case "inlineStr":
// echo 'Inline String', PHP_EOL; // echo 'Inline String', PHP_EOL;
$value = $this->_parseRichText($c->is); $value = $this->parseRichText($c->is);
break; break;
case "e": case "e":
// echo 'Error', PHP_EOL; // echo 'Error', PHP_EOL;
if (!isset($c->f)) { if (!isset($c->f)) {
$value = self::_castToError($c); $value = self::castToError($c);
} else { } else {
// Formula // Formula
$this->_castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, '_castToError'); $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError');
// echo '$calculatedValue = ', $calculatedValue, PHP_EOL; // echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
} }
break; break;
@ -873,11 +865,11 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
// echo 'Default', PHP_EOL; // echo 'Default', PHP_EOL;
if (!isset($c->f)) { if (!isset($c->f)) {
// echo 'Not a Formula', PHP_EOL; // echo 'Not a Formula', PHP_EOL;
$value = self::_castToString($c); $value = self::castToString($c);
} else { } else {
// echo 'Treat as Formula', PHP_EOL; // echo 'Treat as Formula', PHP_EOL;
// Formula // Formula
$this->_castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, '_castToString'); $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToString');
// echo '$calculatedValue = ', $calculatedValue, PHP_EOL; // echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
} }
break; break;
@ -1280,7 +1272,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
if (!empty($comment['authorId'])) { if (!empty($comment['authorId'])) {
$docSheet->getComment((string)$comment['ref'])->setAuthor($authors[(string)$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));
} }
} }
@ -1654,7 +1646,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
} }
break; break;
} }
} else if (!isset($definedName['localSheetId'])) { } elseif (!isset($definedName['localSheetId'])) {
// "Global" definedNames // "Global" definedNames
$locatedSheet = null; $locatedSheet = null;
$extractedSheetName = ''; $extractedSheetName = '';
@ -1732,15 +1724,15 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
return $excel; return $excel;
} }
private static function _readColor($color, $background = false) private static function readColor($color, $background = false)
{ {
if (isset($color["rgb"])) { if (isset($color["rgb"])) {
return (string)$color["rgb"]; return (string)$color["rgb"];
} else if (isset($color["indexed"])) { } elseif (isset($color["indexed"])) {
return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB(); return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB();
} else if (isset($color["theme"])) { } elseif (isset($color["theme"])) {
if (self::$_theme !== null) { if (self::$theme !== null) {
$returnColour = self::$_theme->getColourByIndex((int)$color["theme"]); $returnColour = self::$theme->getColourByIndex((int)$color["theme"]);
if (isset($color["tint"])) { if (isset($color["tint"])) {
$tintAdjust = (float) $color["tint"]; $tintAdjust = (float) $color["tint"];
$returnColour = PHPExcel_Style_Color::changeBrightness($returnColour, $tintAdjust); $returnColour = PHPExcel_Style_Color::changeBrightness($returnColour, $tintAdjust);
@ -1755,7 +1747,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
return 'FF000000'; return 'FF000000';
} }
private static function _readStyle($docStyle, $style) private static function readStyle($docStyle, $style)
{ {
// format code // format code
// if (isset($style->numFmt)) { // if (isset($style->numFmt)) {
@ -1779,11 +1771,11 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
if (isset($style->font->strike)) { if (isset($style->font->strike)) {
$docStyle->getFont()->setStrikethrough(!isset($style->font->strike["val"]) || self::boolean((string) $style->font->strike["val"])); $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"])) { if (isset($style->font->u) && !isset($style->font->u["val"])) {
$docStyle->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); $docStyle->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
} else if (isset($style->font->u) && isset($style->font->u["val"])) { } elseif (isset($style->font->u) && isset($style->font->u["val"])) {
$docStyle->getFont()->setUnderline((string)$style->font->u["val"]); $docStyle->getFont()->setUnderline((string)$style->font->u["val"]);
} }
@ -1807,18 +1799,18 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
} }
$docStyle->getFill()->setRotation(floatval($gradientFill["degree"])); $docStyle->getFill()->setRotation(floatval($gradientFill["degree"]));
$gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); $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()->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()->getEndColor()->setARGB(self::readColor(self::array_item($gradientFill->xpath("sml:stop[@position=1]"))->color));
} elseif ($style->fill->patternFill) { } elseif ($style->fill->patternFill) {
$patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid'; $patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid';
$docStyle->getFill()->setFillType($patternType); $docStyle->getFill()->setFillType($patternType);
if ($style->fill->patternFill->fgColor) { 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 { } else {
$docStyle->getFill()->getStartColor()->setARGB('FF000000'); $docStyle->getFill()->getStartColor()->setARGB('FF000000');
} }
if ($style->fill->patternFill->bgColor) { 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));
} }
} }
} }
@ -1836,11 +1828,11 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
} else { } else {
$docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH); $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH);
} }
self::_readBorder($docStyle->getBorders()->getLeft(), $style->border->left); self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left);
self::_readBorder($docStyle->getBorders()->getRight(), $style->border->right); self::readBorder($docStyle->getBorders()->getRight(), $style->border->right);
self::_readBorder($docStyle->getBorders()->getTop(), $style->border->top); self::readBorder($docStyle->getBorders()->getTop(), $style->border->top);
self::_readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom); self::readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom);
self::_readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal); self::readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal);
} }
// alignment // alignment
@ -1851,7 +1843,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
$textRotation = 0; $textRotation = 0;
if ((int)$style->alignment["textRotation"] <= 90) { if ((int)$style->alignment["textRotation"] <= 90) {
$textRotation = (int)$style->alignment["textRotation"]; $textRotation = (int)$style->alignment["textRotation"];
} else if ((int)$style->alignment["textRotation"] > 90) { } elseif ((int)$style->alignment["textRotation"] > 90) {
$textRotation = 90 - (int)$style->alignment["textRotation"]; $textRotation = 90 - (int)$style->alignment["textRotation"];
} }
@ -1887,17 +1879,17 @@ 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"])) { if (isset($eleBorder["style"])) {
$docBorder->setBorderStyle((string) $eleBorder["style"]); $docBorder->setBorderStyle((string) $eleBorder["style"]);
} }
if (isset($eleBorder->color)) { 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(); $value = new PHPExcel_RichText();
@ -1919,7 +1911,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
$objText->getFont()->setSize((string) $run->rPr->sz["val"]); $objText->getFont()->setSize((string) $run->rPr->sz["val"]);
} }
if (isset($run->rPr->color)) { 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"])) || if ((isset($run->rPr->b["val"]) && self::boolean((string) $run->rPr->b["val"])) ||
(isset($run->rPr->b) && !isset($run->rPr->b["val"]))) { (isset($run->rPr->b) && !isset($run->rPr->b["val"]))) {
@ -1940,7 +1932,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
} }
if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) { if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) {
$objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
} else if (isset($run->rPr->u) && isset($run->rPr->u["val"])) { } elseif (isset($run->rPr->u) && isset($run->rPr->u["val"])) {
$objText->getFont()->setUnderline((string)$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"])) || if ((isset($run->rPr->strike["val"]) && self::boolean((string) $run->rPr->strike["val"])) ||
@ -1955,7 +1947,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
return $value; return $value;
} }
private function _readRibbon($excel, $customUITarget, $zip) private function readRibbon($excel, $customUITarget, $zip)
{ {
$baseDir = dirname($customUITarget); $baseDir = dirname($customUITarget);
$nameCustomUI = basename($customUITarget); $nameCustomUI = basename($customUITarget);

View File

@ -34,7 +34,7 @@
*/ */
class PHPExcel_Reader_Excel2007_Chart class PHPExcel_Reader_Excel2007_Chart
{ {
private static function _getAttribute($component, $name, $format) private static function getAttribute($component, $name, $format)
{ {
$attributes = $component->attributes(); $attributes = $component->attributes();
if (isset($attributes[$name])) { if (isset($attributes[$name])) {
@ -49,14 +49,14 @@ class PHPExcel_Reader_Excel2007_Chart
} }
} }
return null; return null;
} // function _getAttribute() }
private static function _readColor($color, $background = false) private static function readColor($color, $background = false)
{ {
if (isset($color["rgb"])) { if (isset($color["rgb"])) {
return (string)$color["rgb"]; return (string)$color["rgb"];
} else if (isset($color["indexed"])) { } elseif (isset($color["indexed"])) {
return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB(); return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB();
} }
} }
@ -81,82 +81,82 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($chartDetails as $chartDetailKey => $chartDetail) { foreach ($chartDetails as $chartDetailKey => $chartDetail) {
switch ($chartDetailKey) { switch ($chartDetailKey) {
case "layout": case "layout":
$plotAreaLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta, 'plotArea'); $plotAreaLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'plotArea');
break; break;
case "catAx": case "catAx":
if (isset($chartDetail->title)) { 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; break;
case "dateAx": case "dateAx":
if (isset($chartDetail->title)) { 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; break;
case "valAx": case "valAx":
if (isset($chartDetail->title)) { 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; break;
case "barChart": case "barChart":
case "bar3DChart": case "bar3DChart":
$barDirection = self::_getAttribute($chartDetail->barDir, 'val', 'string'); $barDirection = self::getAttribute($chartDetail->barDir, 'val', 'string');
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotDirection($barDirection); $plotSer->setPlotDirection($barDirection);
$plotSeries[] = $plotSer; $plotSeries[] = $plotSer;
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "lineChart": case "lineChart":
case "line3DChart": case "line3DChart":
$plotSeries[] = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "areaChart": case "areaChart":
case "area3DChart": case "area3DChart":
$plotSeries[] = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "doughnutChart": case "doughnutChart":
case "pieChart": case "pieChart":
case "pie3DChart": case "pie3DChart":
$explosion = isset($chartDetail->ser->explosion); $explosion = isset($chartDetail->ser->explosion);
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($explosion); $plotSer->setPlotStyle($explosion);
$plotSeries[] = $plotSer; $plotSeries[] = $plotSer;
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "scatterChart": case "scatterChart":
$scatterStyle = self::_getAttribute($chartDetail->scatterStyle, 'val', 'string'); $scatterStyle = self::getAttribute($chartDetail->scatterStyle, 'val', 'string');
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($scatterStyle); $plotSer->setPlotStyle($scatterStyle);
$plotSeries[] = $plotSer; $plotSeries[] = $plotSer;
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "bubbleChart": case "bubbleChart":
$bubbleScale = self::_getAttribute($chartDetail->bubbleScale, 'val', 'integer'); $bubbleScale = self::getAttribute($chartDetail->bubbleScale, 'val', 'integer');
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($bubbleScale); $plotSer->setPlotStyle($bubbleScale);
$plotSeries[] = $plotSer; $plotSeries[] = $plotSer;
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "radarChart": case "radarChart":
$radarStyle = self::_getAttribute($chartDetail->radarStyle, 'val', 'string'); $radarStyle = self::getAttribute($chartDetail->radarStyle, 'val', 'string');
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($radarStyle); $plotSer->setPlotStyle($radarStyle);
$plotSeries[] = $plotSer; $plotSeries[] = $plotSer;
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "surfaceChart": case "surfaceChart":
case "surface3DChart": case "surface3DChart":
$wireFrame = self::_getAttribute($chartDetail->wireframe, 'val', 'boolean'); $wireFrame = self::getAttribute($chartDetail->wireframe, 'val', 'boolean');
$plotSer = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($wireFrame); $plotSer->setPlotStyle($wireFrame);
$plotSeries[] = $plotSer; $plotSeries[] = $plotSer;
$plotAttributes = self::_readChartAttributes($chartDetail); $plotAttributes = self::readChartAttributes($chartDetail);
break; break;
case "stockChart": case "stockChart":
$plotSeries[] = self::_chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey); $plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotAttributes = self::_readChartAttributes($plotAreaLayout); $plotAttributes = self::readChartAttributes($plotAreaLayout);
break; break;
} }
} }
@ -164,16 +164,16 @@ class PHPExcel_Reader_Excel2007_Chart
$plotAreaLayout = new PHPExcel_Chart_Layout(); $plotAreaLayout = new PHPExcel_Chart_Layout();
} }
$plotArea = new PHPExcel_Chart_PlotArea($plotAreaLayout, $plotSeries); $plotArea = new PHPExcel_Chart_PlotArea($plotAreaLayout, $plotSeries);
self::_setChartAttributes($plotAreaLayout, $plotAttributes); self::setChartAttributes($plotAreaLayout, $plotAttributes);
break; break;
case "plotVisOnly": case "plotVisOnly":
$plotVisOnly = self::_getAttribute($chartDetails, 'val', 'string'); $plotVisOnly = self::getAttribute($chartDetails, 'val', 'string');
break; break;
case "dispBlanksAs": case "dispBlanksAs":
$dispBlanksAs = self::_getAttribute($chartDetails, 'val', 'string'); $dispBlanksAs = self::getAttribute($chartDetails, 'val', 'string');
break; break;
case "title": case "title":
$title = self::_chartTitle($chartDetails, $namespacesChartMeta, 'title'); $title = self::chartTitle($chartDetails, $namespacesChartMeta, 'title');
break; break;
case "legend": case "legend":
$legendPos = 'r'; $legendPos = 'r';
@ -182,13 +182,13 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($chartDetails as $chartDetailKey => $chartDetail) { foreach ($chartDetails as $chartDetailKey => $chartDetail) {
switch ($chartDetailKey) { switch ($chartDetailKey) {
case "legendPos": case "legendPos":
$legendPos = self::_getAttribute($chartDetail, 'val', 'string'); $legendPos = self::getAttribute($chartDetail, 'val', 'string');
break; break;
case "overlay": case "overlay":
$legendOverlay = self::_getAttribute($chartDetail, 'val', 'boolean'); $legendOverlay = self::getAttribute($chartDetail, 'val', 'boolean');
break; break;
case "layout": case "layout":
$legendLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta, 'legend'); $legendLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'legend');
break; break;
} }
} }
@ -201,9 +201,9 @@ class PHPExcel_Reader_Excel2007_Chart
$chart = new PHPExcel_Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel); $chart = new PHPExcel_Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel);
return $chart; return $chart;
} // function readChart() }
private static function _chartTitle($titleDetails, $namespacesChartMeta, $type) private static function chartTitle($titleDetails, $namespacesChartMeta, $type)
{ {
$caption = array(); $caption = array();
$titleLayout = null; $titleLayout = null;
@ -215,20 +215,20 @@ class PHPExcel_Reader_Excel2007_Chart
switch ($titleKey) { switch ($titleKey) {
case "p": case "p":
$titleDetailPart = $titleDetail->children($namespacesChartMeta['a']); $titleDetailPart = $titleDetail->children($namespacesChartMeta['a']);
$caption[] = self::_parseRichText($titleDetailPart); $caption[] = self::parseRichText($titleDetailPart);
} }
} }
break; break;
case "layout": case "layout":
$titleLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta); $titleLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta);
break; break;
} }
} }
return new PHPExcel_Chart_Title($caption, $titleLayout); 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)) { if (!isset($chartDetail->manualLayout)) {
return null; return null;
@ -239,13 +239,13 @@ class PHPExcel_Reader_Excel2007_Chart
} }
$layout = array(); $layout = array();
foreach ($details as $detailKey => $detail) { foreach ($details as $detailKey => $detail) {
// echo $detailKey, ' => ',self::_getAttribute($detail, 'val', 'string'),PHP_EOL; // echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL;
$layout[$detailKey] = self::_getAttribute($detail, 'val', 'string'); $layout[$detailKey] = self::getAttribute($detail, 'val', 'string');
} }
return new PHPExcel_Chart_Layout($layout); return new PHPExcel_Chart_Layout($layout);
} // function _chartLayoutDetails() }
private static function _chartDataSeries($chartDetail, $namespacesChartMeta, $plotType) private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType)
{ {
$multiSeriesType = null; $multiSeriesType = null;
$smoothLine = false; $smoothLine = false;
@ -255,76 +255,78 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($seriesDetailSet as $seriesDetailKey => $seriesDetails) { foreach ($seriesDetailSet as $seriesDetailKey => $seriesDetails) {
switch ($seriesDetailKey) { switch ($seriesDetailKey) {
case "grouping": case "grouping":
$multiSeriesType = self::_getAttribute($chartDetail->grouping, 'val', 'string'); $multiSeriesType = self::getAttribute($chartDetail->grouping, 'val', 'string');
break; break;
case "ser": case "ser":
$marker = null; $marker = null;
foreach ($seriesDetails as $seriesKey => $seriesDetail) { foreach ($seriesDetails as $seriesKey => $seriesDetail) {
switch ($seriesKey) { switch ($seriesKey) {
case "idx": case "idx":
$seriesIndex = self::_getAttribute($seriesDetail, 'val', 'integer'); $seriesIndex = self::getAttribute($seriesDetail, 'val', 'integer');
break; break;
case "order": case "order":
$seriesOrder = self::_getAttribute($seriesDetail, 'val', 'integer'); $seriesOrder = self::getAttribute($seriesDetail, 'val', 'integer');
$plotOrder[$seriesIndex] = $seriesOrder; $plotOrder[$seriesIndex] = $seriesOrder;
break; break;
case "tx": case "tx":
$seriesLabel[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta); $seriesLabel[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
break; break;
case "marker": case "marker":
$marker = self::_getAttribute($seriesDetail->symbol, 'val', 'string'); $marker = self::getAttribute($seriesDetail->symbol, 'val', 'string');
break; break;
case "smooth": case "smooth":
$smoothLine = self::_getAttribute($seriesDetail, 'val', 'boolean'); $smoothLine = self::getAttribute($seriesDetail, 'val', 'boolean');
break; break;
case "cat": case "cat":
$seriesCategory[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta); $seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
break; break;
case "val": case "val":
$seriesValues[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker); $seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
break; break;
case "xVal": case "xVal":
$seriesCategory[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker); $seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
break; break;
case "yVal": case "yVal":
$seriesValues[$seriesIndex] = self::_chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker); $seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
break; break;
} }
} }
} }
} }
return new PHPExcel_Chart_DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine); 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)) { if (isset($seriesDetail->strRef)) {
$seriesSource = (string) $seriesDetail->strRef->f; $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); return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->numRef)) { } elseif (isset($seriesDetail->numRef)) {
$seriesSource = (string) $seriesDetail->numRef->f; $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); return new PHPExcel_Chart_DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->multiLvlStrRef)) { } elseif (isset($seriesDetail->multiLvlStrRef)) {
$seriesSource = (string) $seriesDetail->multiLvlStrRef->f; $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']); $seriesData['pointCount'] = count($seriesData['dataValues']);
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->multiLvlNumRef)) { } elseif (isset($seriesDetail->multiLvlNumRef)) {
$seriesSource = (string) $seriesDetail->multiLvlNumRef->f; $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']); $seriesData['pointCount'] = count($seriesData['dataValues']);
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine); return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} }
return null; return null;
} // function _chartDataSeriesValueSet() }
private static function _chartDataSeriesValues($seriesValueSet, $dataType = 'n')
private static function chartDataSeriesValues($seriesValueSet, $dataType = 'n')
{ {
$seriesVal = array(); $seriesVal = array();
$formatCode = ''; $formatCode = '';
@ -333,13 +335,13 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($seriesValueSet as $seriesValueIdx => $seriesValue) { foreach ($seriesValueSet as $seriesValueIdx => $seriesValue) {
switch ($seriesValueIdx) { switch ($seriesValueIdx) {
case 'ptCount': case 'ptCount':
$pointCount = self::_getAttribute($seriesValue, 'val', 'integer'); $pointCount = self::getAttribute($seriesValue, 'val', 'integer');
break; break;
case 'formatCode': case 'formatCode':
$formatCode = (string) $seriesValue; $formatCode = (string) $seriesValue;
break; break;
case 'pt': case 'pt':
$pointVal = self::_getAttribute($seriesValue, 'idx', 'integer'); $pointVal = self::getAttribute($seriesValue, 'idx', 'integer');
if ($dataType == 's') { if ($dataType == 's') {
$seriesVal[$pointVal] = (string) $seriesValue->v; $seriesVal[$pointVal] = (string) $seriesValue->v;
} else { } else {
@ -358,9 +360,9 @@ class PHPExcel_Reader_Excel2007_Chart
'pointCount' => $pointCount, 'pointCount' => $pointCount,
'dataValues' => $seriesVal 'dataValues' => $seriesVal
); );
} // function _chartDataSeriesValues() }
private static function _chartDataSeriesValuesMultiLevel($seriesValueSet, $dataType = 'n') private static function chartDataSeriesValuesMultiLevel($seriesValueSet, $dataType = 'n')
{ {
$seriesVal = array(); $seriesVal = array();
$formatCode = ''; $formatCode = '';
@ -370,13 +372,13 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($seriesLevel as $seriesValueIdx => $seriesValue) { foreach ($seriesLevel as $seriesValueIdx => $seriesValue) {
switch ($seriesValueIdx) { switch ($seriesValueIdx) {
case 'ptCount': case 'ptCount':
$pointCount = self::_getAttribute($seriesValue, 'val', 'integer'); $pointCount = self::getAttribute($seriesValue, 'val', 'integer');
break; break;
case 'formatCode': case 'formatCode':
$formatCode = (string) $seriesValue; $formatCode = (string) $seriesValue;
break; break;
case 'pt': case 'pt':
$pointVal = self::_getAttribute($seriesValue, 'idx', 'integer'); $pointVal = self::getAttribute($seriesValue, 'idx', 'integer');
if ($dataType == 's') { if ($dataType == 's') {
$seriesVal[$pointVal][] = (string) $seriesValue->v; $seriesVal[$pointVal][] = (string) $seriesValue->v;
} else { } else {
@ -392,9 +394,9 @@ class PHPExcel_Reader_Excel2007_Chart
'pointCount' => $pointCount, 'pointCount' => $pointCount,
'dataValues' => $seriesVal 'dataValues' => $seriesVal
); );
} // function _chartDataSeriesValuesMultiLevel() }
private static function _parseRichText($titleDetailPart = null) private static function parseRichText($titleDetailPart = null)
{ {
$value = new PHPExcel_RichText(); $value = new PHPExcel_RichText();
@ -407,27 +409,27 @@ class PHPExcel_Reader_Excel2007_Chart
$objText->getFont()->setName((string) $titleDetailElement->rPr->rFont["val"]); $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)) { if (!is_null($fontSize)) {
$objText->getFont()->setSize(floor($fontSize / 100)); $objText->getFont()->setSize(floor($fontSize / 100));
} }
$fontColor = (self::_getAttribute($titleDetailElement->rPr, 'color', 'string')); $fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string'));
if (!is_null($fontColor)) { 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)) { if (!is_null($bold)) {
$objText->getFont()->setBold($bold); $objText->getFont()->setBold($bold);
} }
$italic = self::_getAttribute($titleDetailElement->rPr, 'i', 'boolean'); $italic = self::getAttribute($titleDetailElement->rPr, 'i', 'boolean');
if (!is_null($italic)) { if (!is_null($italic)) {
$objText->getFont()->setItalic($italic); $objText->getFont()->setItalic($italic);
} }
$baseline = self::_getAttribute($titleDetailElement->rPr, 'baseline', 'integer'); $baseline = self::getAttribute($titleDetailElement->rPr, 'baseline', 'integer');
if (!is_null($baseline)) { if (!is_null($baseline)) {
if ($baseline > 0) { if ($baseline > 0) {
$objText->getFont()->setSuperScript(true); $objText->getFont()->setSuperScript(true);
@ -436,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 (!is_null($underscore)) {
if ($underscore == 'sng') { if ($underscore == 'sng') {
$objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
@ -447,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 (!is_null($strikethrough)) {
if ($strikethrough == 'noStrike') { if ($strikethrough == 'noStrike') {
$objText->getFont()->setStrikethrough(false); $objText->getFont()->setStrikethrough(false);
@ -461,37 +463,37 @@ class PHPExcel_Reader_Excel2007_Chart
return $value; return $value;
} }
private static function _readChartAttributes($chartDetail) private static function readChartAttributes($chartDetail)
{ {
$plotAttributes = array(); $plotAttributes = array();
if (isset($chartDetail->dLbls)) { if (isset($chartDetail->dLbls)) {
if (isset($chartDetail->dLbls->howLegendKey)) { 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)) { 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)) { 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)) { 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)) { 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)) { 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)) { 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; return $plotAttributes;
} }
private static function _setChartAttributes($plotArea, $plotAttributes) private static function setChartAttributes($plotArea, $plotAttributes)
{ {
foreach ($plotAttributes as $plotAttributeKey => $plotAttributeValue) { foreach ($plotAttributes as $plotAttributeKey => $plotAttributeValue) {
switch ($plotAttributeKey) { switch ($plotAttributeKey) {

View File

@ -40,21 +40,21 @@ class PHPExcel_Reader_Excel2007_Theme
* *
* @var string * @var string
*/ */
private $_themeName; private $themeName;
/** /**
* Colour Scheme Name * Colour Scheme Name
* *
* @var string * @var string
*/ */
private $_colourSchemeName; private $colourSchemeName;
/** /**
* Colour Map indexed by position * Colour Map indexed by position
* *
* @var array of string * @var array of string
*/ */
private $_colourMapValues; private $colourMapValues;
/** /**
@ -62,7 +62,7 @@ class PHPExcel_Reader_Excel2007_Theme
* *
* @var array of string * @var array of string
*/ */
private $_colourMap; private $colourMap;
/** /**
@ -72,9 +72,9 @@ class PHPExcel_Reader_Excel2007_Theme
public function __construct($themeName, $colourSchemeName, $colourMap) public function __construct($themeName, $colourSchemeName, $colourMap)
{ {
// Initialise values // Initialise values
$this->_themeName = $themeName; $this->themeName = $themeName;
$this->_colourSchemeName = $colourSchemeName; $this->colourSchemeName = $colourSchemeName;
$this->_colourMap = $colourMap; $this->colourMap = $colourMap;
} }
/** /**
@ -84,7 +84,7 @@ class PHPExcel_Reader_Excel2007_Theme
*/ */
public function getThemeName() public function getThemeName()
{ {
return $this->_themeName; return $this->themeName;
} }
/** /**
@ -94,7 +94,7 @@ class PHPExcel_Reader_Excel2007_Theme
*/ */
public function getColourSchemeName() public function getColourSchemeName()
{ {
return $this->_colourSchemeName; return $this->colourSchemeName;
} }
/** /**
@ -104,8 +104,8 @@ class PHPExcel_Reader_Excel2007_Theme
*/ */
public function getColourByIndex($index = 0) public function getColourByIndex($index = 0)
{ {
if (isset($this->_colourMap[$index])) { if (isset($this->colourMap[$index])) {
return $this->_colourMap[$index]; return $this->colourMap[$index];
} }
return null; return null;
} }

View File

@ -2192,9 +2192,9 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$rotation = 0; $rotation = 0;
if ($angle <= 90) { if ($angle <= 90) {
$rotation = $angle; $rotation = $angle;
} else if ($angle <= 180) { } elseif ($angle <= 180) {
$rotation = 90 - $angle; $rotation = 90 - $angle;
} else if ($angle == 255) { } elseif ($angle == 255) {
$rotation = -165; $rotation = -165;
} }
$objStyle->getAlignment()->setTextRotation($rotation); $objStyle->getAlignment()->setTextRotation($rotation);
@ -4598,11 +4598,11 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
if ($isUNC) { if ($isUNC) {
$hyperlinkType = 'UNC'; $hyperlinkType = 'UNC';
} else if (!$isFileLinkOrUrl) { } elseif (!$isFileLinkOrUrl) {
$hyperlinkType = 'workbook'; $hyperlinkType = 'workbook';
} else if (ord($recordData{$offset}) == 0x03) { } elseif (ord($recordData{$offset}) == 0x03) {
$hyperlinkType = 'local'; $hyperlinkType = 'local';
} else if (ord($recordData{$offset}) == 0xE0) { } elseif (ord($recordData{$offset}) == 0xE0) {
$hyperlinkType = 'URL'; $hyperlinkType = 'URL';
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Reader_Excel5_Escher
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Reader_Excel5_Escher
{ {
const DGGCONTAINER = 0xF000; const DGGCONTAINER = 0xF000;
@ -58,28 +51,28 @@ class PHPExcel_Reader_Excel5_Escher
* *
* @var string * @var string
*/ */
private $_data; private $data;
/** /**
* Size in bytes of the Escher stream data * Size in bytes of the Escher stream data
* *
* @var int * @var int
*/ */
private $_dataSize; private $dataSize;
/** /**
* Current position of stream pointer in Escher stream data * Current position of stream pointer in Escher stream data
* *
* @var int * @var int
*/ */
private $_pos; private $pos;
/** /**
* The object to be returned by the reader. Modified during load. * The object to be returned by the reader. Modified during load.
* *
* @var mixed * @var mixed
*/ */
private $_object; private $object;
/** /**
* Create a new PHPExcel_Reader_Excel5_Escher instance * Create a new PHPExcel_Reader_Excel5_Escher instance
@ -88,7 +81,7 @@ class PHPExcel_Reader_Excel5_Escher
*/ */
public function __construct($object) public function __construct($object)
{ {
$this->_object = $object; $this->object = $object;
} }
/** /**
@ -98,117 +91,117 @@ class PHPExcel_Reader_Excel5_Escher
*/ */
public function load($data) public function load($data)
{ {
$this->_data = $data; $this->data = $data;
// total byte size of Excel data (workbook global substream + sheet substreams) // 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 // Parse Escher stream
while ($this->_pos < $this->_dataSize) { while ($this->pos < $this->dataSize) {
// offset: 2; size: 2: Record Type // 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) { switch ($fbt) {
case self::DGGCONTAINER: case self::DGGCONTAINER:
$this->_readDggContainer(); $this->readDggContainer();
break; break;
case self::DGG: case self::DGG:
$this->_readDgg(); $this->readDgg();
break; break;
case self::BSTORECONTAINER: case self::BSTORECONTAINER:
$this->_readBstoreContainer(); $this->readBstoreContainer();
break; break;
case self::BSE: case self::BSE:
$this->_readBSE(); $this->readBSE();
break; break;
case self::BLIPJPEG: case self::BLIPJPEG:
$this->_readBlipJPEG(); $this->readBlipJPEG();
break; break;
case self::BLIPPNG: case self::BLIPPNG:
$this->_readBlipPNG(); $this->readBlipPNG();
break; break;
case self::OPT: case self::OPT:
$this->_readOPT(); $this->readOPT();
break; break;
case self::TERTIARYOPT: case self::TERTIARYOPT:
$this->_readTertiaryOPT(); $this->readTertiaryOPT();
break; break;
case self::SPLITMENUCOLORS: case self::SPLITMENUCOLORS:
$this->_readSplitMenuColors(); $this->readSplitMenuColors();
break; break;
case self::DGCONTAINER: case self::DGCONTAINER:
$this->_readDgContainer(); $this->readDgContainer();
break; break;
case self::DG: case self::DG:
$this->_readDg(); $this->readDg();
break; break;
case self::SPGRCONTAINER: case self::SPGRCONTAINER:
$this->_readSpgrContainer(); $this->readSpgrContainer();
break; break;
case self::SPCONTAINER: case self::SPCONTAINER:
$this->_readSpContainer(); $this->readSpContainer();
break; break;
case self::SPGR: case self::SPGR:
$this->_readSpgr(); $this->readSpgr();
break; break;
case self::SP: case self::SP:
$this->_readSp(); $this->readSp();
break; break;
case self::CLIENTTEXTBOX: case self::CLIENTTEXTBOX:
$this->_readClientTextbox(); $this->readClientTextbox();
break; break;
case self::CLIENTANCHOR: case self::CLIENTANCHOR:
$this->_readClientAnchor(); $this->readClientAnchor();
break; break;
case self::CLIENTDATA: case self::CLIENTDATA:
$this->_readClientData(); $this->readClientData();
break; break;
default: default:
$this->_readDefault(); $this->readDefault();
break; break;
} }
} }
return $this->_object; return $this->object;
} }
/** /**
* Read a generic record * Read a generic record
*/ */
private function _readDefault() private function readDefault()
{ {
// offset 0; size: 2; recVer and recInstance // 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 // 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 // bit: 0-3; mask: 0x000F; recVer
$recVer = (0x000F & $verInstance) >> 0; $recVer = (0x000F & $verInstance) >> 0;
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
* Read DggContainer record (Drawing Group Container) * Read DggContainer record (Drawing Group Container)
*/ */
private function _readDggContainer() private function readDggContainer()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$dggContainer = new PHPExcel_Shared_Escher_DggContainer(); $dggContainer = new PHPExcel_Shared_Escher_DggContainer();
$this->_object->setDggContainer($dggContainer); $this->object->setDggContainer($dggContainer);
$reader = new PHPExcel_Reader_Excel5_Escher($dggContainer); $reader = new PHPExcel_Reader_Excel5_Escher($dggContainer);
$reader->load($recordData); $reader->load($recordData);
} }
@ -216,29 +209,29 @@ class PHPExcel_Reader_Excel5_Escher
/** /**
* Read Dgg record (Drawing Group) * Read Dgg record (Drawing Group)
*/ */
private function _readDgg() private function readDgg()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
* Read BstoreContainer record (Blip Store Container) * Read BstoreContainer record (Blip Store Container)
*/ */
private function _readBstoreContainer() private function readBstoreContainer()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer(); $bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer();
$this->_object->setBstoreContainer($bstoreContainer); $this->object->setBstoreContainer($bstoreContainer);
$reader = new PHPExcel_Reader_Excel5_Escher($bstoreContainer); $reader = new PHPExcel_Reader_Excel5_Escher($bstoreContainer);
$reader->load($recordData); $reader->load($recordData);
} }
@ -246,22 +239,22 @@ class PHPExcel_Reader_Excel5_Escher
/** /**
* Read BSE record * Read BSE record
*/ */
private function _readBSE() private function readBSE()
{ {
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
// add BSE to BstoreContainer // add BSE to BstoreContainer
$BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE(); $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE();
$this->_object->addBSE($BSE); $this->object->addBSE($BSE);
$BSE->setBLIPType($recInstance); $BSE->setBLIPType($recInstance);
@ -312,18 +305,18 @@ class PHPExcel_Reader_Excel5_Escher
/** /**
* Read BlipJPEG record. Holds raw JPEG image data * Read BlipJPEG record. Holds raw JPEG image data
*/ */
private function _readBlipJPEG() private function readBlipJPEG()
{ {
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
$pos = 0; $pos = 0;
@ -347,24 +340,24 @@ class PHPExcel_Reader_Excel5_Escher
$blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip();
$blip->setData($data); $blip->setData($data);
$this->_object->setBlip($blip); $this->object->setBlip($blip);
} }
/** /**
* Read BlipPNG record. Holds raw PNG image data * Read BlipPNG record. Holds raw PNG image data
*/ */
private function _readBlipPNG() private function readBlipPNG()
{ {
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
$pos = 0; $pos = 0;
@ -388,71 +381,71 @@ class PHPExcel_Reader_Excel5_Escher
$blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip();
$blip->setData($data); $blip->setData($data);
$this->_object->setBlip($blip); $this->object->setBlip($blip);
} }
/** /**
* Read OPT record. This record may occur within DggContainer record or SpContainer * 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 // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // 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 * Read TertiaryOPT record
*/ */
private function _readTertiaryOPT() private function readTertiaryOPT()
{ {
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
* Read SplitMenuColors record * Read SplitMenuColors record
*/ */
private function _readSplitMenuColors() private function readSplitMenuColors()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
* Read DgContainer record (Drawing Container) * Read DgContainer record (Drawing Container)
*/ */
private function _readDgContainer() private function readDgContainer()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$dgContainer = new PHPExcel_Shared_Escher_DgContainer(); $dgContainer = new PHPExcel_Shared_Escher_DgContainer();
$this->_object->setDgContainer($dgContainer); $this->object->setDgContainer($dgContainer);
$reader = new PHPExcel_Reader_Excel5_Escher($dgContainer); $reader = new PHPExcel_Reader_Excel5_Escher($dgContainer);
$escher = $reader->load($recordData); $escher = $reader->load($recordData);
} }
@ -460,37 +453,37 @@ class PHPExcel_Reader_Excel5_Escher
/** /**
* Read Dg record (Drawing) * Read Dg record (Drawing)
*/ */
private function _readDg() private function readDg()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
* Read SpgrContainer record (Shape Group Container) * Read SpgrContainer record (Shape Group Container)
*/ */
private function _readSpgrContainer() private function readSpgrContainer()
{ {
// context is either context DgContainer or SpgrContainer // context is either context DgContainer or SpgrContainer
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer(); $spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer();
if ($this->_object instanceof PHPExcel_Shared_Escher_DgContainer) { if ($this->object instanceof PHPExcel_Shared_Escher_DgContainer) {
// DgContainer // DgContainer
$this->_object->setSpgrContainer($spgrContainer); $this->object->setSpgrContainer($spgrContainer);
} else { } else {
// SpgrContainer // SpgrContainer
$this->_object->addChild($spgrContainer); $this->object->addChild($spgrContainer);
} }
$reader = new PHPExcel_Reader_Excel5_Escher($spgrContainer); $reader = new PHPExcel_Reader_Excel5_Escher($spgrContainer);
@ -500,17 +493,17 @@ class PHPExcel_Reader_Excel5_Escher
/** /**
* Read SpContainer record (Shape Container) * Read SpContainer record (Shape Container)
*/ */
private function _readSpContainer() private function readSpContainer()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// add spContainer to spgrContainer // add spContainer to spgrContainer
$spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer();
$this->_object->addChild($spContainer); $this->object->addChild($spContainer);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
// record is a container, read contents // record is a container, read contents
$reader = new PHPExcel_Reader_Excel5_Escher($spContainer); $reader = new PHPExcel_Reader_Excel5_Escher($spContainer);
@ -520,59 +513,59 @@ class PHPExcel_Reader_Excel5_Escher
/** /**
* Read Spgr record (Shape Group) * Read Spgr record (Shape Group)
*/ */
private function _readSpgr() private function readSpgr()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
* Read Sp record (Shape) * Read Sp record (Shape)
*/ */
private function _readSp() private function readSp()
{ {
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
* Read ClientTextbox record * Read ClientTextbox record
*/ */
private function _readClientTextbox() private function readClientTextbox()
{ {
// offset: 0; size: 2; recVer and recInstance // offset: 0; size: 2; recVer and recInstance
// bit: 4-15; mask: 0xFFF0; 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // 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 * 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); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // 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) // offset: 2; size: 2; upper-left corner column index (0-based)
$c1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 2); $c1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 2);
@ -599,34 +592,34 @@ class PHPExcel_Reader_Excel5_Escher
$endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16); $endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16);
// set the start coordinates // 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 // set the start offsetX
$this->_object->setStartOffsetX($startOffsetX); $this->object->setStartOffsetX($startOffsetX);
// set the start offsetY // set the start offsetY
$this->_object->setStartOffsetY($startOffsetY); $this->object->setStartOffsetY($startOffsetY);
// set the end coordinates // 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 // set the end offsetX
$this->_object->setEndOffsetX($endOffsetX); $this->object->setEndOffsetX($endOffsetX);
// set the end offsetY // set the end offsetY
$this->_object->setEndOffsetY($endOffsetY); $this->object->setEndOffsetY($endOffsetY);
} }
/** /**
* Read ClientData record * Read ClientData record
*/ */
private function _readClientData() private function readClientData()
{ {
$length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); $length = PHPExcel_Reader_Excel5::_GetInt4d($this->data, $this->pos + 4);
$recordData = substr($this->_data, $this->_pos + 8, $length); $recordData = substr($this->data, $this->pos + 8, $length);
// move stream pointer to next record // move stream pointer to next record
$this->_pos += 8 + $length; $this->pos += 8 + $length;
} }
/** /**
@ -635,7 +628,7 @@ class PHPExcel_Reader_Excel5_Escher
* @param string $data Binary data * @param string $data Binary data
* @param int $n Number of properties * @param int $n Number of properties
*/ */
private function _readOfficeArtRGFOPTE($data, $n) private function readOfficeArtRGFOPTE($data, $n)
{ {
$splicedComplexData = substr($data, 6 * $n); $splicedComplexData = substr($data, 6 * $n);
@ -670,7 +663,7 @@ class PHPExcel_Reader_Excel5_Escher
$value = $op; $value = $op;
} }
$this->_object->setOPT($opidOpid, $value); $this->object->setOPT($opidOpid, $value);
} }
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Reader_Excel5_MD5
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,15 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Reader_Excel5_MD5
{ {
// Context // Context

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Reader_Excel5_RC4
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Reader_Excel5_RC4
{ {
// Context // Context

View File

@ -1,6 +1,16 @@
<?php <?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel * PHPExcel_Reader_Gnumeric
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,24 +34,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/** PHPExcel 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 class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
{ {
/** /**
@ -49,16 +41,16 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
* *
* @var array * @var array
*/ */
private $_styles = array(); private $styles = array();
/** /**
* Shared Expressions * Shared Expressions
* *
* @var array * @var array
*/ */
private $_expressions = array(); private $expressions = array();
private $_referenceHelper = null; private $referenceHelper = null;
/** /**
* Create a new PHPExcel_Reader_Gnumeric * Create a new PHPExcel_Reader_Gnumeric
@ -66,7 +58,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
public function __construct() public function __construct()
{ {
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
$this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance(); $this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
} }
/** /**
@ -425,16 +417,16 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$type = PHPExcel_Cell_DataType::TYPE_FORMULA; $type = PHPExcel_Cell_DataType::TYPE_FORMULA;
if ($ExprID > '') { if ($ExprID > '') {
if (((string) $cell) > '') { if (((string) $cell) > '') {
$this->_expressions[$ExprID] = array( $this->expressions[$ExprID] = array(
'column' => $cellAttributes->Col, 'column' => $cellAttributes->Col,
'row' => $cellAttributes->Row, 'row' => $cellAttributes->Row,
'formula' => (string) $cell 'formula' => (string) $cell
); );
// echo 'NEW EXPRESSION ', $ExprID,'<br />'; // echo 'NEW EXPRESSION ', $ExprID,'<br />';
} else { } 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 'SHARED EXPRESSION ', $ExprID,'<br />';
// echo 'New Value is ', $cell,'<br />'; // echo 'New Value is ', $cell,'<br />';
} }

View File

@ -1,6 +1,16 @@
<?php <?php
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/** /**
* PHPExcel * PHPExcel_Reader_OOCalc
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,24 +34,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/** PHPExcel 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 class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader
{ {
/** /**
@ -49,7 +41,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
* *
* @var array * @var array
*/ */
private $_styles = array(); private $styles = array();
/** /**
* Create a new PHPExcel_Reader_OOCalc * Create a new PHPExcel_Reader_OOCalc
@ -520,7 +512,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
} }
$text = implode("\n", $textArray); $text = implode("\n", $textArray);
// echo $text, '<br />'; // echo $text, '<br />';
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->_parseRichText($text)); $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text));
// ->setAuthor( $author ) // ->setAuthor( $author )
} }
@ -693,7 +685,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
return $objPHPExcel; return $objPHPExcel;
} }
private function _parseRichText($is = '') private function parseRichText($is = '')
{ {
$value = new PHPExcel_RichText(); $value = new PHPExcel_RichText();

View File

@ -49,28 +49,28 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
* *
* @var string * @var string
*/ */
private $_inputEncoding = 'ANSI'; private $inputEncoding = 'ANSI';
/** /**
* Sheet index to read * Sheet index to read
* *
* @var int * @var int
*/ */
private $_sheetIndex = 0; private $sheetIndex = 0;
/** /**
* Formats * Formats
* *
* @var array * @var array
*/ */
private $_formats = array(); private $formats = array();
/** /**
* Format Count * Format Count
* *
* @var int * @var int
*/ */
private $_format = 0; private $format = 0;
/** /**
* Create a new PHPExcel_Reader_SYLK * Create a new PHPExcel_Reader_SYLK
@ -112,7 +112,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
*/ */
public function setInputEncoding($pValue = 'ANSI') public function setInputEncoding($pValue = 'ANSI')
{ {
$this->_inputEncoding = $pValue; $this->inputEncoding = $pValue;
return $this; return $this;
} }
@ -123,7 +123,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
*/ */
public function getInputEncoding() public function getInputEncoding()
{ {
return $this->_inputEncoding; return $this->inputEncoding;
} }
/** /**
@ -231,10 +231,10 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
rewind($fileHandle); rewind($fileHandle);
// Create new PHPExcel // Create new PHPExcel
while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) { while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
$objPHPExcel->createSheet(); $objPHPExcel->createSheet();
} }
$objPHPExcel->setActiveSheetIndex($this->_sheetIndex); $objPHPExcel->setActiveSheetIndex($this->sheetIndex);
$fromFormats = array('\-', '\ '); $fromFormats = array('\-', '\ ');
$toFormats = array('-', ' '); $toFormats = array('-', ' ');
@ -295,7 +295,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
break; break;
} }
} }
$this->_formats['P'.$this->_format++] = $formatArray; $this->formats['P'.$this->format++] = $formatArray;
// Read cell value data // Read cell value data
} elseif ($dataType == 'C') { } elseif ($dataType == 'C') {
$hasCalculatedValue = false; $hasCalculatedValue = false;
@ -361,12 +361,12 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
} }
} }
$columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1);
$cellData = PHPExcel_Calculation::_unwrapResult($cellData); $cellData = PHPExcel_Calculation::unwrapResult($cellData);
// Set cell value // Set cell value
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
if ($hasCalculatedValue) { if ($hasCalculatedValue) {
$cellData = PHPExcel_Calculation::_unwrapResult($cellData); $cellData = PHPExcel_Calculation::unwrapResult($cellData);
$objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData);
} }
// Read cell formatting // Read cell formatting
@ -418,8 +418,8 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
} }
if (($formatStyle > '') && ($column > '') && ($row > '')) { if (($formatStyle > '') && ($column > '') && ($row > '')) {
$columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1);
if (isset($this->_formats[$formatStyle])) { if (isset($this->formats[$formatStyle])) {
$objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->_formats[$formatStyle]); $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]);
} }
} }
if ((!empty($styleData)) && ($column > '') && ($row > '')) { if ((!empty($styleData)) && ($column > '') && ($row > '')) {
@ -469,7 +469,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
*/ */
public function getSheetIndex() public function getSheetIndex()
{ {
return $this->_sheetIndex; return $this->sheetIndex;
} }
/** /**
@ -480,7 +480,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
*/ */
public function setSheetIndex($pValue = 0) public function setSheetIndex($pValue = 0)
{ {
$this->_sheetIndex = $pValue; $this->sheetIndex = $pValue;
return $this; return $this;
} }
} }

View File

@ -39,7 +39,7 @@ class PHPExcel_ReferenceHelper
* *
* @var PHPExcel_ReferenceHelper * @var PHPExcel_ReferenceHelper
*/ */
private static $_instance; private static $instance;
/** /**
* Get an instance of this class * Get an instance of this class
@ -48,11 +48,11 @@ class PHPExcel_ReferenceHelper
*/ */
public static function getInstance() public static function getInstance()
{ {
if (!isset(self::$_instance) || (self::$_instance === null)) { if (!isset(self::$instance) || (self::$instance === null)) {
self::$_instance = new PHPExcel_ReferenceHelper(); 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 $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @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(); $aBreaks = $pSheet->getBreaks();
($pNumCols > 0 || $pNumRows > 0) ? ($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 $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @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(); $aComments = $pSheet->getComments();
$aNewComments = array(); // the new array of all comments $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 $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @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(); $aHyperlinkCollection = $pSheet->getHyperlinkCollection();
($pNumCols > 0 || $pNumRows > 0) ? uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellSort')); ($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 $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @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(); $aDataValidationCollection = $pSheet->getDataValidationCollection();
($pNumCols > 0 || $pNumRows > 0) ? uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellSort')); ($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 $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @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(); $aMergeCells = $pSheet->getMergeCells();
$aNewMergeCells = array(); // the new array of all merge cells $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 $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @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(); $aProtectedCells = $pSheet->getProtectedCells();
($pNumCols > 0 || $pNumRows > 0) ? ($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 $beforeRow Number of the row we're inserting/deleting before
* @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion) * @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); $aColumnDimensions = array_reverse($pSheet->getColumnDimensions(), true);
if (!empty($aColumnDimensions)) { if (!empty($aColumnDimensions)) {
@ -343,7 +343,7 @@ class PHPExcel_ReferenceHelper
* @param integer $beforeRow Number of the row we're inserting/deleting before * @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) * @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); $aRowDimensions = array_reverse($pSheet->getRowDimensions(), true);
if (!empty($aRowDimensions)) { if (!empty($aRowDimensions)) {
@ -513,28 +513,28 @@ class PHPExcel_ReferenceHelper
} }
// Update worksheet: column dimensions // Update worksheet: column dimensions
$this->_adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: row dimensions // Update worksheet: row dimensions
$this->_adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: page breaks // Update worksheet: page breaks
$this->_adjustPageBreaks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustPageBreaks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: comments // Update worksheet: comments
$this->_adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: hyperlinks // Update worksheet: hyperlinks
$this->_adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: data validations // Update worksheet: data validations
$this->_adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: merge cells // Update worksheet: merge cells
$this->_adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: protected cells // Update worksheet: protected cells
$this->_adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows); $this->adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows);
// Update worksheet: autofilter // Update worksheet: autofilter
$autoFilter = $pSheet->getAutoFilter(); $autoFilter = $pSheet->getAutoFilter();
@ -785,10 +785,10 @@ class PHPExcel_ReferenceHelper
// Is it a range or a single cell? // Is it a range or a single cell?
} elseif (strpos($pCellRange, ':') === false && strpos($pCellRange, ',') === false) { } elseif (strpos($pCellRange, ':') === false && strpos($pCellRange, ',') === false) {
// Single cell // Single cell
return $this->_updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows); return $this->updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows);
} elseif (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) { } elseif (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {
// Range // Range
return $this->_updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows); return $this->updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows);
} else { } else {
// Return original // Return original
return $pCellRange; return $pCellRange;
@ -833,7 +833,7 @@ class PHPExcel_ReferenceHelper
* @return string Updated cell range * @return string Updated cell range
* @throws PHPExcel_Exception * @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) { if (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {
// Update range // Update range
@ -843,13 +843,13 @@ class PHPExcel_ReferenceHelper
$jc = count($range[$i]); $jc = count($range[$i]);
for ($j = 0; $j < $jc; ++$j) { for ($j = 0; $j < $jc; ++$j) {
if (ctype_alpha($range[$i][$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]; $range[$i][$j] = $r[0];
} elseif (ctype_digit($range[$i][$j])) { } 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]; $range[$i][$j] = $r[1];
} else { } 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 * @return string Updated cell reference
* @throws PHPExcel_Exception * @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) { if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) {
// Get coordinates of $pBefore // Get coordinates of $pBefore

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_Shared_Escher
*
* @category PHPExcel
* @package PHPExcel_Shared_Escher
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Shared_Escher class PHPExcel_Shared_Escher
{ {
/** /**
@ -39,14 +32,14 @@ class PHPExcel_Shared_Escher
* *
* @var PHPExcel_Shared_Escher_DggContainer * @var PHPExcel_Shared_Escher_DggContainer
*/ */
private $_dggContainer; private $dggContainer;
/** /**
* Drawing Container * Drawing Container
* *
* @var PHPExcel_Shared_Escher_DgContainer * @var PHPExcel_Shared_Escher_DgContainer
*/ */
private $_dgContainer; private $dgContainer;
/** /**
* Get Drawing Group Container * Get Drawing Group Container
@ -55,7 +48,7 @@ class PHPExcel_Shared_Escher
*/ */
public function getDggContainer() public function getDggContainer()
{ {
return $this->_dggContainer; return $this->dggContainer;
} }
/** /**
@ -65,7 +58,7 @@ class PHPExcel_Shared_Escher
*/ */
public function setDggContainer($dggContainer) public function setDggContainer($dggContainer)
{ {
return $this->_dggContainer = $dggContainer; return $this->dggContainer = $dggContainer;
} }
/** /**
@ -75,7 +68,7 @@ class PHPExcel_Shared_Escher
*/ */
public function getDgContainer() public function getDgContainer()
{ {
return $this->_dgContainer; return $this->dgContainer;
} }
/** /**
@ -85,6 +78,6 @@ class PHPExcel_Shared_Escher
*/ */
public function setDgContainer($dgContainer) public function setDgContainer($dgContainer)
{ {
return $this->_dgContainer = $dgContainer; return $this->dgContainer = $dgContainer;
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher_DgContainer
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Shared_Escher_DgContainer
{ {
/** /**
@ -39,44 +32,44 @@ class PHPExcel_Shared_Escher_DgContainer
* *
* @var int * @var int
*/ */
private $_dgId; private $dgId;
/** /**
* Last shape index in this drawing * Last shape index in this drawing
* *
* @var int * @var int
*/ */
private $_lastSpId; private $lastSpId;
private $_spgrContainer = null; private $spgrContainer = null;
public function getDgId() public function getDgId()
{ {
return $this->_dgId; return $this->dgId;
} }
public function setDgId($value) public function setDgId($value)
{ {
$this->_dgId = $value; $this->dgId = $value;
} }
public function getLastSpId() public function getLastSpId()
{ {
return $this->_lastSpId; return $this->lastSpId;
} }
public function setLastSpId($value) public function setLastSpId($value)
{ {
$this->_lastSpId = $value; $this->lastSpId = $value;
} }
public function getSpgrContainer() public function getSpgrContainer()
{ {
return $this->_spgrContainer; return $this->spgrContainer;
} }
public function setSpgrContainer($spgrContainer) public function setSpgrContainer($spgrContainer)
{ {
return $this->_spgrContainer = $spgrContainer; return $this->spgrContainer = $spgrContainer;
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher_DgContainer_SpgrContainer
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
{ {
/** /**
@ -39,14 +32,14 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
* *
* @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer * @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer
*/ */
private $_parent; private $parent;
/** /**
* Shape Container collection * Shape Container collection
* *
* @var array * @var array
*/ */
private $_children = array(); private $children = array();
/** /**
* Set parent Shape Group Container * Set parent Shape Group Container
@ -55,7 +48,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
*/ */
public function setParent($parent) public function setParent($parent)
{ {
$this->_parent = $parent; $this->parent = $parent;
} }
/** /**
@ -65,7 +58,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
*/ */
public function getParent() public function getParent()
{ {
return $this->_parent; return $this->parent;
} }
/** /**
@ -75,7 +68,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
*/ */
public function addChild($child) public function addChild($child)
{ {
$this->_children[] = $child; $this->children[] = $child;
$child->setParent($this); $child->setParent($this);
} }
@ -84,7 +77,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
*/ */
public function getChildren() public function getChildren()
{ {
return $this->_children; return $this->children;
} }
/** /**
@ -96,7 +89,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer
{ {
$allSpContainers = array(); $allSpContainers = array();
foreach ($this->_children as $child) { foreach ($this->children as $child) {
if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) { if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
$allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers()); $allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers());
} else { } else {

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
{ {
/** /**
@ -39,84 +32,84 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
* *
* @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer * @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer
*/ */
private $_parent; private $parent;
/** /**
* Is this a group shape? * Is this a group shape?
* *
* @var boolean * @var boolean
*/ */
private $_spgr = false; private $spgr = false;
/** /**
* Shape type * Shape type
* *
* @var int * @var int
*/ */
private $_spType; private $spType;
/** /**
* Shape flag * Shape flag
* *
* @var int * @var int
*/ */
private $_spFlag; private $spFlag;
/** /**
* Shape index (usually group shape has index 0, and the rest: 1,2,3...) * Shape index (usually group shape has index 0, and the rest: 1,2,3...)
* *
* @var boolean * @var boolean
*/ */
private $_spId; private $spId;
/** /**
* Array of options * Array of options
* *
* @var array * @var array
*/ */
private $_OPT; private $OPT;
/** /**
* Cell coordinates of upper-left corner of shape, e.g. 'A1' * Cell coordinates of upper-left corner of shape, e.g. 'A1'
* *
* @var string * @var string
*/ */
private $_startCoordinates; private $startCoordinates;
/** /**
* Horizontal offset of upper-left corner of shape measured in 1/1024 of column width * Horizontal offset of upper-left corner of shape measured in 1/1024 of column width
* *
* @var int * @var int
*/ */
private $_startOffsetX; private $startOffsetX;
/** /**
* Vertical offset of upper-left corner of shape measured in 1/256 of row height * Vertical offset of upper-left corner of shape measured in 1/256 of row height
* *
* @var int * @var int
*/ */
private $_startOffsetY; private $startOffsetY;
/** /**
* Cell coordinates of bottom-right corner of shape, e.g. 'B2' * Cell coordinates of bottom-right corner of shape, e.g. 'B2'
* *
* @var string * @var string
*/ */
private $_endCoordinates; private $endCoordinates;
/** /**
* Horizontal offset of bottom-right corner of shape measured in 1/1024 of column width * Horizontal offset of bottom-right corner of shape measured in 1/1024 of column width
* *
* @var int * @var int
*/ */
private $_endOffsetX; private $endOffsetX;
/** /**
* Vertical offset of bottom-right corner of shape measured in 1/256 of row height * Vertical offset of bottom-right corner of shape measured in 1/256 of row height
* *
* @var int * @var int
*/ */
private $_endOffsetY; private $endOffsetY;
/** /**
* Set parent Shape Group Container * Set parent Shape Group Container
@ -125,7 +118,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function setParent($parent) public function setParent($parent)
{ {
$this->_parent = $parent; $this->parent = $parent;
} }
/** /**
@ -135,7 +128,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function getParent() 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) 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() public function getSpgr()
{ {
return $this->_spgr; return $this->spgr;
} }
/** /**
@ -165,7 +158,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function setSpType($value) public function setSpType($value)
{ {
$this->_spType = $value; $this->spType = $value;
} }
/** /**
@ -175,7 +168,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function getSpType() public function getSpType()
{ {
return $this->_spType; return $this->spType;
} }
/** /**
@ -185,7 +178,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function setSpFlag($value) public function setSpFlag($value)
{ {
$this->_spFlag = $value; $this->spFlag = $value;
} }
/** /**
@ -195,7 +188,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function getSpFlag() public function getSpFlag()
{ {
return $this->_spFlag; return $this->spFlag;
} }
/** /**
@ -205,7 +198,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function setSpId($value) public function setSpId($value)
{ {
$this->_spId = $value; $this->spId = $value;
} }
/** /**
@ -215,7 +208,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function getSpId() 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) 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) public function getOPT($property)
{ {
if (isset($this->_OPT[$property])) { if (isset($this->OPT[$property])) {
return $this->_OPT[$property]; return $this->OPT[$property];
} }
return null; return null;
} }
@ -250,7 +243,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
*/ */
public function getOPTCollection() 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') 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() 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) 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() 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) 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() 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') 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() 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) 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() 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) 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() public function getEndOffsetY()
{ {
return $this->_endOffsetY; return $this->endOffsetY;
} }
/** /**

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher_DggContainer
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Shared_Escher_DggContainer
{ {
/** /**
@ -39,42 +32,42 @@ class PHPExcel_Shared_Escher_DggContainer
* *
* @var int * @var int
*/ */
private $_spIdMax; private $spIdMax;
/** /**
* Total number of drawings saved * Total number of drawings saved
* *
* @var int * @var int
*/ */
private $_cDgSaved; private $cDgSaved;
/** /**
* Total number of shapes saved (including group shapes) * Total number of shapes saved (including group shapes)
* *
* @var int * @var int
*/ */
private $_cSpSaved; private $cSpSaved;
/** /**
* BLIP Store Container * BLIP Store Container
* *
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer
*/ */
private $_bstoreContainer; private $bstoreContainer;
/** /**
* Array of options for the drawing group * Array of options for the drawing group
* *
* @var array * @var array
*/ */
private $_OPT = array(); private $OPT = array();
/** /**
* Array of identifier clusters containg information about the maximum shape identifiers * Array of identifier clusters containg information about the maximum shape identifiers
* *
* @var array * @var array
*/ */
private $_IDCLs = array(); private $IDCLs = array();
/** /**
* Get maximum shape index of all shapes in all drawings (plus one) * Get maximum shape index of all shapes in all drawings (plus one)
@ -83,7 +76,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function getSpIdMax() public function getSpIdMax()
{ {
return $this->_spIdMax; return $this->spIdMax;
} }
/** /**
@ -93,7 +86,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function setSpIdMax($value) public function setSpIdMax($value)
{ {
$this->_spIdMax = $value; $this->spIdMax = $value;
} }
/** /**
@ -103,7 +96,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function getCDgSaved() public function getCDgSaved()
{ {
return $this->_cDgSaved; return $this->cDgSaved;
} }
/** /**
@ -113,7 +106,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function setCDgSaved($value) public function setCDgSaved($value)
{ {
$this->_cDgSaved = $value; $this->cDgSaved = $value;
} }
/** /**
@ -123,7 +116,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function getCSpSaved() public function getCSpSaved()
{ {
return $this->_cSpSaved; return $this->cSpSaved;
} }
/** /**
@ -133,7 +126,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function setCSpSaved($value) public function setCSpSaved($value)
{ {
$this->_cSpSaved = $value; $this->cSpSaved = $value;
} }
/** /**
@ -143,7 +136,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function getBstoreContainer() public function getBstoreContainer()
{ {
return $this->_bstoreContainer; return $this->bstoreContainer;
} }
/** /**
@ -153,7 +146,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function setBstoreContainer($bstoreContainer) public function setBstoreContainer($bstoreContainer)
{ {
$this->_bstoreContainer = $bstoreContainer; $this->bstoreContainer = $bstoreContainer;
} }
/** /**
@ -164,7 +157,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function setOPT($property, $value) 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) public function getOPT($property)
{ {
if (isset($this->_OPT[$property])) { if (isset($this->OPT[$property])) {
return $this->_OPT[$property]; return $this->OPT[$property];
} }
return null; return null;
} }
@ -188,7 +181,7 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function getIDCLs() public function getIDCLs()
{ {
return $this->_IDCLs; return $this->IDCLs;
} }
/** /**
@ -198,6 +191,6 @@ class PHPExcel_Shared_Escher_DggContainer
*/ */
public function setIDCLs($pValue) public function setIDCLs($pValue)
{ {
$this->_IDCLs = $pValue; $this->IDCLs = $pValue;
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher_DggContainer_BstoreContainer
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
{ {
/** /**
@ -39,7 +32,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
* *
* @var array * @var array
*/ */
private $_BSECollection = array(); private $BSECollection = array();
/** /**
* Add a BLIP Store Entry * Add a BLIP Store Entry
@ -48,7 +41,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
*/ */
public function addBSE($BSE) public function addBSE($BSE)
{ {
$this->_BSECollection[] = $BSE; $this->BSECollection[] = $BSE;
$BSE->setParent($this); $BSE->setParent($this);
} }
@ -59,6 +52,6 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer
*/ */
public function getBSECollection() public function getBSECollection()
{ {
return $this->_BSECollection; return $this->BSECollection;
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
{ {
const BLIPTYPE_ERROR = 0x00; const BLIPTYPE_ERROR = 0x00;
@ -57,14 +50,14 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
* *
* @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
*/ */
private $_blip; private $blip;
/** /**
* The BLIP type * The BLIP type
* *
* @var int * @var int
*/ */
private $_blipType; private $blipType;
/** /**
* Set parent BLIP Store Entry Container * Set parent BLIP Store Entry Container
@ -83,7 +76,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
*/ */
public function getBlip() public function getBlip()
{ {
return $this->_blip; return $this->blip;
} }
/** /**
@ -93,7 +86,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
*/ */
public function setBlip($blip) public function setBlip($blip)
{ {
$this->_blip = $blip; $this->blip = $blip;
$blip->setParent($this); $blip->setParent($this);
} }
@ -104,7 +97,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
*/ */
public function getBlipType() public function getBlipType()
{ {
return $this->_blipType; return $this->blipType;
} }
/** /**
@ -114,6 +107,6 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
*/ */
public function setBlipType($blipType) public function setBlipType($blipType)
{ {
$this->_blipType = $blipType; $this->blipType = $blipType;
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_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 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 * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE
*/ */
private $_parent; private $parent;
/** /**
* Raw image data * Raw image data
* *
* @var string * @var string
*/ */
private $_data; private $data;
/** /**
* Get the raw image data * Get the raw image data
@ -55,7 +48,7 @@ class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
*/ */
public function getData() 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) 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) 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() public function getParent()
{ {
return $this->_parent; return $this->parent;
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/** /**
* PHPExcel * PHPExcel_Shared_Excel5
* *
* Copyright (c) 2006 - 2015 PHPExcel * Copyright (c) 2006 - 2015 PHPExcel
* *
@ -24,14 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
/**
* PHPExcel_Shared_Excel5
*
* @category PHPExcel
* @package PHPExcel_Shared
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Shared_Excel5 class PHPExcel_Shared_Excel5
{ {
/** /**
@ -56,7 +49,7 @@ class PHPExcel_Shared_Excel5
$columnDimension = $columnDimensions[$col]; $columnDimension = $columnDimensions[$col];
$width = $columnDimension->getWidth(); $width = $columnDimension->getWidth();
$pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font); $pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font);
} else if ($sheet->getDefaultColumnDimension()->getWidth() != -1) { } elseif ($sheet->getDefaultColumnDimension()->getWidth() != -1) {
// then we have default column dimension with explicit width // then we have default column dimension with explicit width
$defaultColumnDimension = $sheet->getDefaultColumnDimension(); $defaultColumnDimension = $sheet->getDefaultColumnDimension();
$width = $defaultColumnDimension->getWidth(); $width = $defaultColumnDimension->getWidth();
@ -98,7 +91,7 @@ class PHPExcel_Shared_Excel5
$rowDimension = $rowDimensions[$row]; $rowDimension = $rowDimensions[$row];
$rowHeight = $rowDimension->getRowHeight(); $rowHeight = $rowDimension->getRowHeight();
$pixelRowHeight = (int) ceil(4 * $rowHeight / 3); // here we assume Arial 10 $pixelRowHeight = (int) ceil(4 * $rowHeight / 3); // here we assume Arial 10
} else if ($sheet->getDefaultRowDimension()->getRowHeight() != -1) { } elseif ($sheet->getDefaultRowDimension()->getRowHeight() != -1) {
// then we have a default row dimension with explicit height // then we have a default row dimension with explicit height
$defaultRowDimension = $sheet->getDefaultRowDimension(); $defaultRowDimension = $sheet->getDefaultRowDimension();
$rowHeight = $defaultRowDimension->getRowHeight(); $rowHeight = $defaultRowDimension->getRowHeight();

View File

@ -39,7 +39,7 @@ class PHPExcel_Shared_Font
const AUTOSIZE_METHOD_APPROX = 'approx'; const AUTOSIZE_METHOD_APPROX = 'approx';
const AUTOSIZE_METHOD_EXACT = 'exact'; const AUTOSIZE_METHOD_EXACT = 'exact';
private static $_autoSizeMethods = array( private static $autoSizeMethods = array(
self::AUTOSIZE_METHOD_APPROX, self::AUTOSIZE_METHOD_APPROX,
self::AUTOSIZE_METHOD_EXACT, self::AUTOSIZE_METHOD_EXACT,
); );
@ -196,7 +196,7 @@ class PHPExcel_Shared_Font
*/ */
public static function setAutoSizeMethod($pValue = self::AUTOSIZE_METHOD_APPROX) public static function setAutoSizeMethod($pValue = self::AUTOSIZE_METHOD_APPROX)
{ {
if (!in_array($pValue, self::$_autoSizeMethods)) { if (!in_array($pValue, self::$autoSizeMethods)) {
return false; return false;
} }
self::$autoSizeMethod = $pValue; self::$autoSizeMethod = $pValue;

View File

@ -444,7 +444,7 @@ class EigenvalueDecomposition
--$n; --$n;
$iter = 0; $iter = 0;
// Two roots found // Two roots found
} else if ($l == $n-1) { } elseif ($l == $n-1) {
$w = $this->H[$n][$n-1] * $this->H[$n-1][$n]; $w = $this->H[$n][$n-1] * $this->H[$n-1][$n];
$p = ($this->H[$n-1][$n-1] - $this->H[$n][$n]) / 2.0; $p = ($this->H[$n-1][$n-1] - $this->H[$n][$n]) / 2.0;
$q = $p * $p + $w; $q = $p * $p + $w;
@ -687,7 +687,7 @@ class EigenvalueDecomposition
} }
} }
// Complex vector // Complex vector
} else if ($q < 0) { } elseif ($q < 0) {
$l = $n-1; $l = $n-1;
// Last vector component imaginary so matrix is triangular // Last vector component imaginary so matrix is triangular
if (abs($this->H[$n][$n-1]) > abs($this->H[$n-1][$n])) { if (abs($this->H[$n][$n-1]) > abs($this->H[$n-1][$n])) {

View File

@ -273,7 +273,7 @@ class SingularValueDecomposition
} }
if ($ks == $k) { if ($ks == $k) {
$kase = 3; $kase = 3;
} else if ($ks == $p-1) { } elseif ($ks == $p-1) {
$kase = 1; $kase = 1;
} else { } else {
$kase = 2; $kase = 2;

View File

@ -72,7 +72,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
if (is_resource($filename)) { if (is_resource($filename)) {
$this->_FILEH_ = $filename; $this->_FILEH_ = $filename;
} else if ($filename == '-' || $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_dir = PHPExcel_Shared_File::sys_get_temp_dir();
} }

View File

@ -273,7 +273,7 @@ class PHPExcel_Shared_OLERead
// Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook) // Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook)
if (($upName === 'WORKBOOK') || ($upName === 'BOOK')) { if (($upName === 'WORKBOOK') || ($upName === 'BOOK')) {
$this->wrkbook = count($this->props) - 1; $this->wrkbook = count($this->props) - 1;
} else if ($upName === 'ROOT ENTRY' || $upName === 'R') { } elseif ($upName === 'ROOT ENTRY' || $upName === 'R') {
// Root entry // Root entry
$this->rootentry = count($this->props) - 1; $this->rootentry = count($this->props) - 1;
} }

View File

@ -319,7 +319,7 @@ class PclZip
// ----- Look for the optional second argument // ----- Look for the optional second argument
if ($v_size == 2) { if ($v_size == 2) {
$v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
} else if ($v_size > 2) { } elseif ($v_size > 2) {
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
return 0; return 0;
} }
@ -345,7 +345,7 @@ class PclZip
// ----- The list is a list of string names // ----- The list is a list of string names
$v_string_list = $p_filelist; $v_string_list = $p_filelist;
} }
} else if (is_string($p_filelist)) { } elseif (is_string($p_filelist)) {
// ----- Look if the $p_filelist is a string // ----- Look if the $p_filelist is a string
// ----- Create a list from the string // ----- Create a list from the string
$v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
@ -487,7 +487,7 @@ class PclZip
// ----- Look for the optional second argument // ----- Look for the optional second argument
if ($v_size == 2) { if ($v_size == 2) {
$v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
} else if ($v_size > 2) { } elseif ($v_size > 2) {
// ----- Error log // ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
@ -516,7 +516,7 @@ class PclZip
// ----- The list is a list of string names // ----- The list is a list of string names
$v_string_list = $p_filelist; $v_string_list = $p_filelist;
} }
} else if (is_string($p_filelist)) { } elseif (is_string($p_filelist)) {
// ----- Look if the $p_filelist is a string // ----- Look if the $p_filelist is a string
// ----- Create a list from the string // ----- Create a list from the string
$v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
@ -748,7 +748,7 @@ class PclZip
// ----- Look for the optional second argument // ----- Look for the optional second argument
if ($v_size == 2) { if ($v_size == 2) {
$v_remove_path = $v_arg_list[1]; $v_remove_path = $v_arg_list[1];
} else if ($v_size > 2) { } elseif ($v_size > 2) {
// ----- Error log // ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
@ -903,7 +903,7 @@ class PclZip
// ----- Look for the optional second argument // ----- Look for the optional second argument
if ($v_size == 2) { if ($v_size == 2) {
$v_remove_path = $v_arg_list[1]; $v_remove_path = $v_arg_list[1];
} else if ($v_size > 2) { } elseif ($v_size > 2) {
// ----- Error log // ----- Error log
PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
@ -1122,7 +1122,7 @@ class PclZip
if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) { if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) {
// ----- Duplicate the archive // ----- Duplicate the archive
$v_result = $this->privDuplicate($p_archive->zipname); $v_result = $this->privDuplicate($p_archive->zipname);
} else if (is_string($p_archive)) { } elseif (is_string($p_archive)) {
// ----- Look if the $p_archive is a string (so a filename) // ----- Look if the $p_archive is a string (so a filename)
// ----- Check that $p_archive is a valid zip file // ----- Check that $p_archive is a valid zip file
// TBC : Should also check the archive format // TBC : Should also check the archive format
@ -1176,7 +1176,7 @@ class PclZip
if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) { if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) {
// ----- Merge the archive // ----- Merge the archive
$v_result = $this->privMerge($p_archive_to_add); $v_result = $this->privMerge($p_archive_to_add);
} else if (is_string($p_archive_to_add)) { } elseif (is_string($p_archive_to_add)) {
// ----- Look if the $p_archive_to_add is a string (so a filename) // ----- Look if the $p_archive_to_add is a string (so a filename)
// ----- Create a temporary archive // ----- Create a temporary archive
$v_object_archive = new PclZip($p_archive_to_add); $v_object_archive = new PclZip($p_archive_to_add);
@ -1466,7 +1466,7 @@ class PclZip
// ----- Get the value // ----- Get the value
if (is_string($p_options_list[$i+1])) { if (is_string($p_options_list[$i+1])) {
$v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];
} else if (is_array($p_options_list[$i+1])) { } elseif (is_array($p_options_list[$i+1])) {
$v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
} else { } else {
// ----- Error log // ----- Error log
@ -1548,9 +1548,9 @@ class PclZip
// ----- Parse items // ----- Parse items
$v_work_list = explode(",", $p_options_list[$i+1]); $v_work_list = explode(",", $p_options_list[$i+1]);
} else if (is_integer($p_options_list[$i+1])) { } elseif (is_integer($p_options_list[$i+1])) {
$v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
} else if (is_array($p_options_list[$i+1])) { } elseif (is_array($p_options_list[$i+1])) {
$v_work_list = $p_options_list[$i+1]; $v_work_list = $p_options_list[$i+1];
} else { } else {
// ----- Error log // ----- Error log
@ -1895,16 +1895,16 @@ class PclZip
if (file_exists($v_descr['filename'])) { if (file_exists($v_descr['filename'])) {
if (@is_file($v_descr['filename'])) { if (@is_file($v_descr['filename'])) {
$v_descr['type'] = 'file'; $v_descr['type'] = 'file';
} else if (@is_dir($v_descr['filename'])) { } elseif (@is_dir($v_descr['filename'])) {
$v_descr['type'] = 'folder'; $v_descr['type'] = 'folder';
} else if (@is_link($v_descr['filename'])) { } elseif (@is_link($v_descr['filename'])) {
// skip // skip
continue; continue;
} else { } else {
// skip // skip
continue; continue;
} }
} else if (isset($v_descr['content'])) { } elseif (isset($v_descr['content'])) {
// ----- Look for string added as file // ----- Look for string added as file
$v_descr['type'] = 'virtual_file'; $v_descr['type'] = 'virtual_file';
} else { } else {
@ -2412,12 +2412,12 @@ class PclZip
if ($p_filedescr['type']=='file') { if ($p_filedescr['type']=='file') {
$p_header['external'] = 0x00000000; $p_header['external'] = 0x00000000;
$p_header['size'] = filesize($p_filename); $p_header['size'] = filesize($p_filename);
} else if ($p_filedescr['type']=='folder') { } elseif ($p_filedescr['type']=='folder') {
// ----- Look for regular folder // ----- Look for regular folder
$p_header['external'] = 0x00000010; $p_header['external'] = 0x00000010;
$p_header['mtime'] = filemtime($p_filename); $p_header['mtime'] = filemtime($p_filename);
$p_header['size'] = filesize($p_filename); $p_header['size'] = filesize($p_filename);
} else if ($p_filedescr['type'] == 'virtual_file') { } elseif ($p_filedescr['type'] == 'virtual_file') {
// ----- Look for virtual file // ----- Look for virtual file
$p_header['external'] = 0x00000000; $p_header['external'] = 0x00000000;
$p_header['size'] = strlen($p_filedescr['content']); $p_header['size'] = strlen($p_filedescr['content']);
@ -2426,7 +2426,7 @@ class PclZip
// ----- Look for filetime // ----- Look for filetime
if (isset($p_filedescr['mtime'])) { if (isset($p_filedescr['mtime'])) {
$p_header['mtime'] = $p_filedescr['mtime']; $p_header['mtime'] = $p_filedescr['mtime'];
} else if ($p_filedescr['type'] == 'virtual_file') { } elseif ($p_filedescr['type'] == 'virtual_file') {
$p_header['mtime'] = time(); $p_header['mtime'] = time();
} else { } else {
$p_header['mtime'] = filemtime($p_filename); $p_header['mtime'] = filemtime($p_filename);
@ -2526,7 +2526,7 @@ class PclZip
// ----- Write the compressed (or not) content // ----- Write the compressed (or not) content
@fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);
} }
} else if ($p_filedescr['type'] == 'virtual_file') { } elseif ($p_filedescr['type'] == 'virtual_file') {
// ----- Look for a virtual file (a file from string) // ----- Look for a virtual file (a file from string)
$v_content = $p_filedescr['content']; $v_content = $p_filedescr['content'];
@ -2556,7 +2556,7 @@ class PclZip
// ----- Write the compressed (or not) content // ----- Write the compressed (or not) content
@fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);
} else if ($p_filedescr['type'] == 'folder') { } elseif ($p_filedescr['type'] == 'folder') {
// ----- Look for a directory // ----- Look for a directory
// ----- Look for directory last '/' // ----- Look for directory last '/'
if (@substr($p_header['stored_filename'], -1) != '/') { if (@substr($p_header['stored_filename'], -1) != '/') {
@ -2761,7 +2761,7 @@ class PclZip
// ----- Look for all path to remove // ----- Look for all path to remove
if ($p_remove_all_dir) { if ($p_remove_all_dir) {
$v_stored_filename = basename($p_filename); $v_stored_filename = basename($p_filename);
} else if ($p_remove_dir != "") { } elseif ($p_remove_dir != "") {
// ----- Look for partial path remove // ----- Look for partial path remove
if (substr($p_remove_dir, -1) != '/') { if (substr($p_remove_dir, -1) != '/') {
$p_remove_dir .= "/"; $p_remove_dir .= "/";
@ -3136,12 +3136,12 @@ class PclZip
$v_extract = true; $v_extract = true;
} }
} }
} else if ((isset($p_options[PCLZIP_OPT_BY_PREG])) && ($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 // ----- Look for extract by preg rule
if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
$v_extract = true; $v_extract = true;
} }
} else if ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { } elseif ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
// ----- Look for extract by index rule // ----- Look for extract by index rule
// ----- Look if the index is in the list // ----- Look if the index is in the list
for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) { for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
@ -3341,7 +3341,7 @@ class PclZip
// ----- Get the basename of the path // ----- Get the basename of the path
$p_entry['filename'] = basename($p_entry['filename']); $p_entry['filename'] = basename($p_entry['filename']);
} else if ($p_remove_path != "") { } elseif ($p_remove_path != "") {
// ----- Look for path to remove // ----- Look for path to remove
if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) { if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) {
// ----- Change the file status // ----- Change the file status
@ -3418,7 +3418,7 @@ class PclZip
PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, "Filename '".$p_entry['filename']."' is already used by an existing directory"); PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, "Filename '".$p_entry['filename']."' is already used by an existing directory");
return PclZip::errorCode(); return PclZip::errorCode();
} }
} else if (!is_writeable($p_entry['filename'])) { } elseif (!is_writeable($p_entry['filename'])) {
// ----- Look if file is write protected // ----- Look if file is write protected
// ----- Change the file status // ----- Change the file status
$p_entry['status'] = "write_protected"; $p_entry['status'] = "write_protected";
@ -3430,7 +3430,7 @@ class PclZip
PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Filename '".$p_entry['filename']."' exists and is write protected"); PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Filename '".$p_entry['filename']."' exists and is write protected");
return PclZip::errorCode(); return PclZip::errorCode();
} }
} else if (filemtime($p_entry['filename']) > $p_entry['mtime']) { } elseif (filemtime($p_entry['filename']) > $p_entry['mtime']) {
// ----- Look if the extracted file is older // ----- Look if the extracted file is older
// ----- Change the file status // ----- Change the file status
if ((isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) && ($p_options[PCLZIP_OPT_REPLACE_NEWER] === true)) { if ((isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) && ($p_options[PCLZIP_OPT_REPLACE_NEWER] === true)) {
@ -3451,7 +3451,7 @@ class PclZip
// ----- Check the directory availability and create it if necessary // ----- Check the directory availability and create it if necessary
if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) { if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) {
$v_dir_to_check = $p_entry['filename']; $v_dir_to_check = $p_entry['filename'];
} else if (!strstr($p_entry['filename'], "/")) { } elseif (!strstr($p_entry['filename'], "/")) {
$v_dir_to_check = ""; $v_dir_to_check = "";
} else { } else {
$v_dir_to_check = dirname($p_entry['filename']); $v_dir_to_check = dirname($p_entry['filename']);
@ -4334,12 +4334,12 @@ class PclZip
$v_found = true; $v_found = true;
} }
} }
} else if ((isset($p_options[PCLZIP_OPT_BY_PREG])) && ($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 // ----- Look for extract by preg rule
if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
$v_found = true; $v_found = true;
} }
} else if ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { } elseif ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
// ----- Look for extract by index rule // ----- Look for extract by index rule
// ----- Look if the index is in the list // ----- Look if the index is in the list
for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) { for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {
@ -4495,7 +4495,7 @@ class PclZip
// ----- Destroy the temporary archive // ----- Destroy the temporary archive
unset($v_temp_zip); unset($v_temp_zip);
} else if ($v_central_dir['entries'] != 0) { } elseif ($v_central_dir['entries'] != 0) {
// ----- Remove every files : reset the file // ----- Remove every files : reset the file
$this->privCloseFd(); $this->privCloseFd();
@ -4915,9 +4915,9 @@ function PclZipUtilPathReduction($p_dir)
if ($v_list[$i] == ".") { if ($v_list[$i] == ".") {
// ----- Ignore this directory // ----- Ignore this directory
// Should be the first $i=0, but no check is done // Should be the first $i=0, but no check is done
} else if ($v_list[$i] == "..") { } elseif ($v_list[$i] == "..") {
$v_skip++; $v_skip++;
} else if ($v_list[$i] == "") { } elseif ($v_list[$i] == "") {
// ----- First '/' i.e. root slash // ----- First '/' i.e. root slash
if ($i == 0) { if ($i == 0) {
$v_result = "/".$v_result; $v_result = "/".$v_result;
@ -4927,7 +4927,7 @@ function PclZipUtilPathReduction($p_dir)
$v_result = $p_dir; $v_result = $p_dir;
$v_skip = 0; $v_skip = 0;
} }
} else if ($i == (sizeof($v_list)-1)) { } elseif ($i == (sizeof($v_list)-1)) {
// ----- Last '/' i.e. indicates a directory // ----- Last '/' i.e. indicates a directory
$v_result = $v_list[$i]; $v_result = $v_list[$i];
} else { } else {
@ -5029,7 +5029,7 @@ function PclZipUtilPathInclusion($p_dir, $p_path)
if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
// ----- There are exactly the same // ----- There are exactly the same
$v_result = 2; $v_result = 2;
} else if ($i < $v_list_dir_size) { } elseif ($i < $v_list_dir_size) {
// ----- The path is shorter than the dir // ----- The path is shorter than the dir
$v_result = 0; $v_result = 0;
} }
@ -5062,21 +5062,21 @@ function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode = 0)
@fwrite($p_dest, $v_buffer, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size);
$p_size -= $v_read_size; $p_size -= $v_read_size;
} }
} else if ($p_mode==1) { } elseif ($p_mode==1) {
while ($p_size != 0) { while ($p_size != 0) {
$v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
$v_buffer = @gzread($p_src, $v_read_size); $v_buffer = @gzread($p_src, $v_read_size);
@fwrite($p_dest, $v_buffer, $v_read_size); @fwrite($p_dest, $v_buffer, $v_read_size);
$p_size -= $v_read_size; $p_size -= $v_read_size;
} }
} else if ($p_mode==2) { } elseif ($p_mode==2) {
while ($p_size != 0) { while ($p_size != 0) {
$v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
$v_buffer = @fread($p_src, $v_read_size); $v_buffer = @fread($p_src, $v_read_size);
@gzwrite($p_dest, $v_buffer, $v_read_size); @gzwrite($p_dest, $v_buffer, $v_read_size);
$p_size -= $v_read_size; $p_size -= $v_read_size;
} }
} else if ($p_mode==3) { } elseif ($p_mode==3) {
while ($p_size != 0) { while ($p_size != 0) {
$v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
$v_buffer = @gzread($p_src, $v_read_size); $v_buffer = @gzread($p_src, $v_read_size);
@ -5111,7 +5111,7 @@ function PclZipUtilRename($p_src, $p_dest)
// ----- Try to copy & unlink the src // ----- Try to copy & unlink the src
if (!@copy($p_src, $p_dest)) { if (!@copy($p_src, $p_dest)) {
$v_result = 0; $v_result = 0;
} else if (!@unlink($p_src)) { } elseif (!@unlink($p_src)) {
$v_result = 0; $v_result = 0;
} }
} }

View File

@ -504,7 +504,7 @@ class PHPExcel_Shared_String
if ($from == 'UTF-16LE') { if ($from == 'UTF-16LE') {
return self::utf16_decode($value, false); return self::utf16_decode($value, false);
} else if ($from == 'UTF-16BE') { } elseif ($from == 'UTF-16BE') {
return self::utf16_decode($value); return self::utf16_decode($value);
} }
// else, no conversion // else, no conversion

View File

@ -358,7 +358,7 @@ class PHPExcel_Style extends PHPExcel_Style_Supervisor implements PHPExcel_IComp
// Selection type, inspect // Selection type, inspect
if (preg_match('/^[A-Z]+1:[A-Z]+1048576$/', $pRange)) { if (preg_match('/^[A-Z]+1:[A-Z]+1048576$/', $pRange)) {
$selectionType = 'COLUMN'; $selectionType = 'COLUMN';
} else if (preg_match('/^A[0-9]+:XFD[0-9]+$/', $pRange)) { } elseif (preg_match('/^A[0-9]+:XFD[0-9]+$/', $pRange)) {
$selectionType = 'ROW'; $selectionType = 'ROW';
} else { } else {
$selectionType = 'CELL'; $selectionType = 'CELL';

View File

@ -2265,9 +2265,9 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable
if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) { if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) {
throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells.'); throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells.');
} else if (strpos($pCellCoordinate, '$') !== false) { } elseif (strpos($pCellCoordinate, '$') !== false) {
throw new PHPExcel_Exception('Cell coordinate string must not be absolute.'); throw new PHPExcel_Exception('Cell coordinate string must not be absolute.');
} else if ($pCellCoordinate == '') { } elseif ($pCellCoordinate == '') {
throw new PHPExcel_Exception('Cell coordinate can not be zero-length string.'); throw new PHPExcel_Exception('Cell coordinate can not be zero-length string.');
} else { } else {
// Check if we already have a comment for this cell. // Check if we already have a comment for this cell.

View File

@ -32,49 +32,49 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
* *
* @var PHPExcel * @var PHPExcel
*/ */
private $_phpExcel; private $phpExcel;
/** /**
* Delimiter * Delimiter
* *
* @var string * @var string
*/ */
private $_delimiter = ','; private $delimiter = ',';
/** /**
* Enclosure * Enclosure
* *
* @var string * @var string
*/ */
private $_enclosure = '"'; private $enclosure = '"';
/** /**
* Line ending * Line ending
* *
* @var string * @var string
*/ */
private $_lineEnding = PHP_EOL; private $lineEnding = PHP_EOL;
/** /**
* Sheet index to write * Sheet index to write
* *
* @var int * @var int
*/ */
private $_sheetIndex = 0; private $sheetIndex = 0;
/** /**
* Whether to write a BOM (for UTF8). * Whether to write a BOM (for UTF8).
* *
* @var boolean * @var boolean
*/ */
private $_useBOM = false; private $useBOM = false;
/** /**
* Whether to write a fully Excel compatible CSV file. * Whether to write a fully Excel compatible CSV file.
* *
* @var boolean * @var boolean
*/ */
private $_excelCompatibility = false; private $excelCompatibility = false;
/** /**
* Create a new PHPExcel_Writer_CSV * 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) 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) public function save($pFilename = null)
{ {
// Fetch sheet // Fetch sheet
$sheet = $this->_phpExcel->getSheet($this->_sheetIndex); $sheet = $this->phpExcel->getSheet($this->sheetIndex);
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->getWriteDebugLog(); $saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog(false); PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
$saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
@ -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."); 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 fwrite($fileHandle, "\xEF\xBB\xBF"); // Enforce UTF-8 BOM Header
$this->setEnclosure('"'); // Set enclosure to " $this->setEnclosure('"'); // Set enclosure to "
$this->setDelimiter(";"); // Set delimiter to a semi-colon $this->setDelimiter(";"); // Set delimiter to a semi-colon
$this->setLineEnding("\r\n"); $this->setLineEnding("\r\n");
fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->_lineEnding); fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->lineEnding);
} elseif ($this->_useBOM) { } elseif ($this->useBOM) {
// Write the UTF-8 BOM code if required // Write the UTF-8 BOM code if required
fwrite($fileHandle, "\xEF\xBB\xBF"); fwrite($fileHandle, "\xEF\xBB\xBF");
} }
@ -135,7 +135,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
fclose($fileHandle); fclose($fileHandle);
PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); 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() 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 = ',') public function setDelimiter($pValue = ',')
{ {
$this->_delimiter = $pValue; $this->delimiter = $pValue;
return $this; return $this;
} }
@ -167,7 +167,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
*/ */
public function getEnclosure() 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 == '') { if ($pValue == '') {
$pValue = null; $pValue = null;
} }
$this->_enclosure = $pValue; $this->enclosure = $pValue;
return $this; return $this;
} }
@ -192,7 +192,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
*/ */
public function getLineEnding() 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) public function setLineEnding($pValue = PHP_EOL)
{ {
$this->_lineEnding = $pValue; $this->lineEnding = $pValue;
return $this; return $this;
} }
@ -214,7 +214,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
*/ */
public function getUseBOM() 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) public function setUseBOM($pValue = false)
{ {
$this->_useBOM = $pValue; $this->useBOM = $pValue;
return $this; return $this;
} }
@ -236,7 +236,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
*/ */
public function getExcelCompatibility() 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) public function setExcelCompatibility($pValue = false)
{ {
$this->_excelCompatibility = $pValue; $this->excelCompatibility = $pValue;
return $this; return $this;
} }
@ -259,7 +259,7 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
*/ */
public function getSheetIndex() 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) public function setSheetIndex($pValue = 0)
{ {
$this->_sheetIndex = $pValue; $this->sheetIndex = $pValue;
return $this; return $this;
} }
@ -292,21 +292,21 @@ class PHPExcel_Writer_CSV extends PHPExcel_Writer_Abstract implements PHPExcel_W
foreach ($pValues as $element) { foreach ($pValues as $element) {
// Escape enclosures // Escape enclosures
$element = str_replace($this->_enclosure, $this->_enclosure . $this->_enclosure, $element); $element = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $element);
// Add delimiter // Add delimiter
if ($writeDelimiter) { if ($writeDelimiter) {
$line .= $this->_delimiter; $line .= $this->delimiter;
} else { } else {
$writeDelimiter = true; $writeDelimiter = true;
} }
// Add enclosed string // Add enclosed string
$line .= $this->_enclosure . $element . $this->_enclosure; $line .= $this->enclosure . $element . $this->enclosure;
} }
// Add line ending // Add line ending
$line .= $this->_lineEnding; $line .= $this->lineEnding;
// Write to file // Write to file
fwrite($pFileHandle, $line); fwrite($pFileHandle, $line);

View File

@ -368,7 +368,7 @@ class PHPExcel_Writer_Excel2007 extends PHPExcel_Writer_Abstract implements PHPE
} }
$objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
} else if ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) { } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) {
ob_start(); ob_start();
call_user_func( call_user_func(
$this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(), $this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(),

View File

@ -145,7 +145,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) { if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) {
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension());
$mimeType = $this->_getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath()); $mimeType = $this->_getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath());
} else if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) { } elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) {
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType()); $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType());
$extension = explode('/', $extension); $extension = explode('/', $extension);
$extension = $extension[1]; $extension = $extension[1];

View File

@ -123,7 +123,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
} }
$objWriter->writeRawData($textToWrite); $objWriter->writeRawData($textToWrite);
$objWriter->endElement(); $objWriter->endElement();
} else if ($textElement instanceof PHPExcel_RichText) { } elseif ($textElement instanceof PHPExcel_RichText) {
$this->writeRichText($objWriter, $textElement); $this->writeRichText($objWriter, $textElement);
} }
@ -184,7 +184,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
$objWriter->startElement($prefix.'vertAlign'); $objWriter->startElement($prefix.'vertAlign');
if ($element->getFont()->getSuperScript()) { if ($element->getFont()->getSuperScript()) {
$objWriter->writeAttribute('val', 'superscript'); $objWriter->writeAttribute('val', 'superscript');
} else if ($element->getFont()->getSubScript()) { } elseif ($element->getFont()->getSubScript()) {
$objWriter->writeAttribute('val', 'subscript'); $objWriter->writeAttribute('val', 'subscript');
} }
$objWriter->endElement(); $objWriter->endElement();
@ -280,7 +280,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
// $objWriter->startElement($prefix.'vertAlign'); // $objWriter->startElement($prefix.'vertAlign');
// if ($element->getFont()->getSuperScript()) { // if ($element->getFont()->getSuperScript()) {
// $objWriter->writeAttribute('val', 'superscript'); // $objWriter->writeAttribute('val', 'superscript');
// } else if ($element->getFont()->getSubScript()) { // } elseif ($element->getFont()->getSubScript()) {
// $objWriter->writeAttribute('val', 'subscript'); // $objWriter->writeAttribute('val', 'subscript');
// } // }
// $objWriter->endElement(); // $objWriter->endElement();
@ -313,7 +313,7 @@ class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_Wr
foreach ($stringTable as $key => $value) { foreach ($stringTable as $key => $value) {
if (! $value instanceof PHPExcel_RichText) { if (! $value instanceof PHPExcel_RichText) {
$returnValue[$value] = $key; $returnValue[$value] = $key;
} else if ($value instanceof PHPExcel_RichText) { } elseif ($value instanceof PHPExcel_RichText) {
$returnValue[$value->getHashCode()] = $key; $returnValue[$value->getHashCode()] = $key;
} }
} }

View File

@ -317,7 +317,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('vertAlign'); $objWriter->startElement('vertAlign');
if ($pFont->getSuperScript() === true) { if ($pFont->getSuperScript() === true) {
$objWriter->writeAttribute('val', 'superscript'); $objWriter->writeAttribute('val', 'superscript');
} else if ($pFont->getSubScript() === true) { } elseif ($pFont->getSubScript() === true) {
$objWriter->writeAttribute('val', 'subscript'); $objWriter->writeAttribute('val', 'subscript');
} }
$objWriter->endElement(); $objWriter->endElement();
@ -428,7 +428,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$textRotation = 0; $textRotation = 0;
if ($pStyle->getAlignment()->getTextRotation() >= 0) { if ($pStyle->getAlignment()->getTextRotation() >= 0) {
$textRotation = $pStyle->getAlignment()->getTextRotation(); $textRotation = $pStyle->getAlignment()->getTextRotation();
} else if ($pStyle->getAlignment()->getTextRotation() < 0) { } elseif ($pStyle->getAlignment()->getTextRotation() < 0) {
$textRotation = 90 - $pStyle->getAlignment()->getTextRotation(); $textRotation = 90 - $pStyle->getAlignment()->getTextRotation();
} }
$objWriter->writeAttribute('textRotation', $textRotation); $objWriter->writeAttribute('textRotation', $textRotation);
@ -493,7 +493,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$textRotation = 0; $textRotation = 0;
if ($pStyle->getAlignment()->getTextRotation() >= 0) { if ($pStyle->getAlignment()->getTextRotation() >= 0) {
$textRotation = $pStyle->getAlignment()->getTextRotation(); $textRotation = $pStyle->getAlignment()->getTextRotation();
} else if ($pStyle->getAlignment()->getTextRotation() < 0) { } elseif ($pStyle->getAlignment()->getTextRotation() < 0) {
$textRotation = 90 - $pStyle->getAlignment()->getTextRotation(); $textRotation = 90 - $pStyle->getAlignment()->getTextRotation();
} }
$objWriter->writeAttribute('textRotation', $textRotation); $objWriter->writeAttribute('textRotation', $textRotation);

View File

@ -506,19 +506,19 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_CONTAINSTEXT && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_CONTAINSTEXT
&& !is_null($conditional->getText())) { && !is_null($conditional->getText())) {
$objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))'); $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))');
} else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BEGINSWITH && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BEGINSWITH
&& !is_null($conditional->getText())) { && !is_null($conditional->getText())) {
$objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
} else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_ENDSWITH && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_ENDSWITH
&& !is_null($conditional->getText())) { && !is_null($conditional->getText())) {
$objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
} else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
&& $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_NOTCONTAINS && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_NOTCONTAINS
&& !is_null($conditional->getText())) { && !is_null($conditional->getText())) {
$objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))'); $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))');
} else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS
|| $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
|| $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) { || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) {
foreach ($conditional->getConditions() as $formula) { foreach ($conditional->getConditions() as $formula) {
@ -910,7 +910,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
foreach ($pSheet->getBreaks() as $cell => $breakType) { foreach ($pSheet->getBreaks() as $cell => $breakType) {
if ($breakType == PHPExcel_Worksheet::BREAK_ROW) { if ($breakType == PHPExcel_Worksheet::BREAK_ROW) {
$aRowBreaks[] = $cell; $aRowBreaks[] = $cell;
} else if ($breakType == PHPExcel_Worksheet::BREAK_COLUMN) { } elseif ($breakType == PHPExcel_Worksheet::BREAK_COLUMN) {
$aColumnBreaks[] = $cell; $aColumnBreaks[] = $cell;
} }
} }
@ -1095,7 +1095,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
case 'inlinestr': // Inline string case 'inlinestr': // Inline string
if (! $cellValue instanceof PHPExcel_RichText) { if (! $cellValue instanceof PHPExcel_RichText) {
$objWriter->writeElement('t', PHPExcel_Shared_String::ControlCharacterPHP2OOXML(htmlspecialchars($cellValue))); $objWriter->writeElement('t', PHPExcel_Shared_String::ControlCharacterPHP2OOXML(htmlspecialchars($cellValue)));
} else if ($cellValue instanceof PHPExcel_RichText) { } elseif ($cellValue instanceof PHPExcel_RichText) {
$objWriter->startElement('is'); $objWriter->startElement('is');
$this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue); $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue);
$objWriter->endElement(); $objWriter->endElement();
@ -1107,7 +1107,7 @@ class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_Writ
if (isset($pFlippedStringTable[$cellValue])) { if (isset($pFlippedStringTable[$cellValue])) {
$objWriter->writeElement('v', $pFlippedStringTable[$cellValue]); $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]);
} }
} else if ($cellValue instanceof PHPExcel_RichText) { } elseif ($cellValue instanceof PHPExcel_RichText) {
$objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]); $objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]);
} }

View File

@ -32,63 +32,63 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
* *
* @var PHPExcel * @var PHPExcel
*/ */
private $_phpExcel; private $phpExcel;
/** /**
* Total number of shared strings in workbook * Total number of shared strings in workbook
* *
* @var int * @var int
*/ */
private $_str_total = 0; private $strTotal = 0;
/** /**
* Number of unique shared strings in workbook * Number of unique shared strings in workbook
* *
* @var int * @var int
*/ */
private $_str_unique = 0; private $strUnique = 0;
/** /**
* Array of unique shared strings in workbook * Array of unique shared strings in workbook
* *
* @var array * @var array
*/ */
private $_str_table = array(); private $strTable = array();
/** /**
* Color cache. Mapping between RGB value and color index. * Color cache. Mapping between RGB value and color index.
* *
* @var array * @var array
*/ */
private $_colors; private $colors;
/** /**
* Formula parser * Formula parser
* *
* @var PHPExcel_Writer_Excel5_Parser * @var PHPExcel_Writer_Excel5_Parser
*/ */
private $_parser; private $parser;
/** /**
* Identifier clusters for drawings. Used in MSODRAWINGGROUP record. * Identifier clusters for drawings. Used in MSODRAWINGGROUP record.
* *
* @var array * @var array
*/ */
private $_IDCLs; private $IDCLs;
/** /**
* Basic OLE object summary information * Basic OLE object summary information
* *
* @var array * @var array
*/ */
private $_summaryInformation; private $summaryInformation;
/** /**
* Extended OLE object document summary information * Extended OLE object document summary information
* *
* @var array * @var array
*/ */
private $_documentSummaryInformation; private $documentSummaryInformation;
/** /**
* Create a new PHPExcel_Writer_Excel5 * 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) 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 // garbage collect
$this->_phpExcel->garbageCollect(); $this->phpExcel->garbageCollect();
$saveDebugLog = PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->getWriteDebugLog(); $saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
PHPExcel_Calculation::getInstance($this->_phpExcel)->getDebugLog()->setWriteDebugLog(false); PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
$saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType(); $saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// initialize colors array // initialize colors array
$this->_colors = array(); $this->colors = array();
// Initialise workbook writer // 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 // Initialise worksheet writers
$countSheets = $this->_phpExcel->getSheetCount(); $countSheets = $this->phpExcel->getSheetCount();
for ($i = 0; $i < $countSheets; ++$i) { 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. // build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook.
$this->_buildWorksheetEschers(); $this->buildWorksheetEschers();
$this->_buildWorkbookEscher(); $this->buildWorkbookEscher();
// add 15 identical cell style Xfs // add 15 identical cell style Xfs
// for now, we use the first cellXf instead of cellStyleXf // for now, we use the first cellXf instead of cellStyleXf
$cellXfCollection = $this->_phpExcel->getCellXfCollection(); $cellXfCollection = $this->phpExcel->getCellXfCollection();
for ($i = 0; $i < 15; ++$i) { for ($i = 0; $i < 15; ++$i) {
$this->_writerWorkbook->addXfWriter($cellXfCollection[0], true); $this->_writerWorkbook->addXfWriter($cellXfCollection[0], true);
} }
// add all the cell Xfs // add all the cell Xfs
foreach ($this->_phpExcel->getCellXfCollection() as $style) { foreach ($this->phpExcel->getCellXfCollection() as $style) {
$this->_writerWorkbook->addXfWriter($style, false); $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()); $OLE->append($this->_writerWorksheets[$i]->getData());
} }
$this->_documentSummaryInformation = $this->_writeDocumentSummaryInformation(); $this->documentSummaryInformation = $this->writeDocumentSummaryInformation();
// initialize OLE Document Summary Information // 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 = 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 // 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 = 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 // define OLE Parts
@ -214,7 +214,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$res = $root->save($pFilename); $res = $root->save($pFilename);
PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType); 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 * Build the Worksheet Escher objects
* *
*/ */
private function _buildWorksheetEschers() private function buildWorksheetEschers()
{ {
// 1-based index to BstoreContainer // 1-based index to BstoreContainer
$blipIndex = 0; $blipIndex = 0;
$lastReducedSpId = 0; $lastReducedSpId = 0;
$lastSpId = 0; $lastSpId = 0;
foreach ($this->_phpExcel->getAllsheets() as $sheet) { foreach ($this->phpExcel->getAllsheets() as $sheet) {
// sheet index // sheet index
$sheetIndex = $sheet->getParent()->getIndex($sheet); $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 // identifier clusters, used for workbook Escher object
$this->_IDCLs[$dgId] = $lastReducedSpId; $this->IDCLs[$dgId] = $lastReducedSpId;
// set last shape index // set last shape index
$dgContainer->setLastSpId($lastSpId); $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 * Build the Escher object corresponding to the MSODRAWINGGROUP record
*/ */
private function _buildWorkbookEscher() private function buildWorkbookEscher()
{ {
$escher = null; $escher = null;
// any drawings in this workbook? // any drawings in this workbook?
$found = false; $found = false;
foreach ($this->_phpExcel->getAllSheets() as $sheet) { foreach ($this->phpExcel->getAllSheets() as $sheet) {
if (count($sheet->getDrawingCollection()) > 0) { if (count($sheet->getDrawingCollection()) > 0) {
$found = true; $found = true;
break; break;
@ -424,14 +424,14 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$escher->setDggContainer($dggContainer); $escher->setDggContainer($dggContainer);
// set IDCLs (identifier clusters) // set IDCLs (identifier clusters)
$dggContainer->setIDCLs($this->_IDCLs); $dggContainer->setIDCLs($this->IDCLs);
// this loop is for determining maximum shape identifier of all drawing // this loop is for determining maximum shape identifier of all drawing
$spIdMax = 0; $spIdMax = 0;
$totalCountShapes = 0; $totalCountShapes = 0;
$countDrawings = 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 $sheetCountShapes = 0; // count number of shapes (minus group shape), in sheet
if (count($sheet->getDrawingCollection()) > 0) { if (count($sheet->getDrawingCollection()) > 0) {
@ -441,7 +441,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
++$sheetCountShapes; ++$sheetCountShapes;
++$totalCountShapes; ++$totalCountShapes;
$spId = $sheetCountShapes | ($this->_phpExcel->getIndex($sheet) + 1) << 10; $spId = $sheetCountShapes | ($this->phpExcel->getIndex($sheet) + 1) << 10;
$spIdMax = max($spId, $spIdMax); $spIdMax = max($spId, $spIdMax);
} }
} }
@ -456,7 +456,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$dggContainer->setBstoreContainer($bstoreContainer); $dggContainer->setBstoreContainer($bstoreContainer);
// the BSE's (all the images) // the BSE's (all the images)
foreach ($this->_phpExcel->getAllsheets() as $sheet) { foreach ($this->phpExcel->getAllsheets() as $sheet) {
foreach ($sheet->getDrawingCollection() as $drawing) { foreach ($sheet->getDrawingCollection() as $drawing) {
if ($drawing instanceof PHPExcel_Worksheet_Drawing) { if ($drawing instanceof PHPExcel_Worksheet_Drawing) {
$filename = $drawing->getPath(); $filename = $drawing->getPath();
@ -498,7 +498,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$BSE->setBlip($blip); $BSE->setBlip($blip);
$bstoreContainer->addBSE($BSE); $bstoreContainer->addBSE($BSE);
} else if ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) { } elseif ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) {
switch ($drawing->getRenderingFunction()) { switch ($drawing->getRenderingFunction()) {
case PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG: case PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG:
$blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG; $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG;
@ -537,7 +537,7 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
* Build the OLE Part for DocumentSummary Information * Build the OLE Part for DocumentSummary Information
* @return string * @return string
*/ */
private function _writeDocumentSummaryInformation() private function writeDocumentSummaryInformation()
{ {
// offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark)
$data = pack('v', 0xFFFE); $data = pack('v', 0xFFFE);
@ -571,8 +571,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$dataSection_NumProps++; $dataSection_NumProps++;
// GKPIDDSI_CATEGORY : Category // GKPIDDSI_CATEGORY : Category
if ($this->_phpExcel->getProperties()->getCategory()) { if ($this->phpExcel->getProperties()->getCategory()) {
$dataProp = $this->_phpExcel->getProperties()->getCategory(); $dataProp = $this->phpExcel->getProperties()->getCategory();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x1E), '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 * Build the OLE Part for Summary Information
* @return string * @return string
*/ */
private function _writeSummaryInformation() private function writeSummaryInformation()
{ {
// offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark)
$data = pack('v', 0xFFFE); $data = pack('v', 0xFFFE);
@ -767,8 +767,8 @@ class PHPExcel_Writer_Excel5 extends PHPExcel_Writer_Abstract implements PHPExce
$dataSection_NumProps++; $dataSection_NumProps++;
// Title // Title
if ($this->_phpExcel->getProperties()->getTitle()) { if ($this->phpExcel->getProperties()->getTitle()) {
$dataProp = $this->_phpExcel->getProperties()->getTitle(); $dataProp = $this->phpExcel->getProperties()->getTitle();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x02),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length '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++; $dataSection_NumProps++;
} }
// Subject // Subject
if ($this->_phpExcel->getProperties()->getSubject()) { if ($this->phpExcel->getProperties()->getSubject()) {
$dataProp = $this->_phpExcel->getProperties()->getSubject(); $dataProp = $this->phpExcel->getProperties()->getSubject();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x03), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x03),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length '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++; $dataSection_NumProps++;
} }
// Author (Creator) // Author (Creator)
if ($this->_phpExcel->getProperties()->getCreator()) { if ($this->phpExcel->getProperties()->getCreator()) {
$dataProp = $this->_phpExcel->getProperties()->getCreator(); $dataProp = $this->phpExcel->getProperties()->getCreator();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x04), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x04),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length '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++; $dataSection_NumProps++;
} }
// Keywords // Keywords
if ($this->_phpExcel->getProperties()->getKeywords()) { if ($this->phpExcel->getProperties()->getKeywords()) {
$dataProp = $this->_phpExcel->getProperties()->getKeywords(); $dataProp = $this->phpExcel->getProperties()->getKeywords();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x05), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x05),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length '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++; $dataSection_NumProps++;
} }
// Comments (Description) // Comments (Description)
if ($this->_phpExcel->getProperties()->getDescription()) { if ($this->phpExcel->getProperties()->getDescription()) {
$dataProp = $this->_phpExcel->getProperties()->getDescription(); $dataProp = $this->phpExcel->getProperties()->getDescription();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x06), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x06),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length '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++; $dataSection_NumProps++;
} }
// Last Saved By (LastModifiedBy) // Last Saved By (LastModifiedBy)
if ($this->_phpExcel->getProperties()->getLastModifiedBy()) { if ($this->phpExcel->getProperties()->getLastModifiedBy()) {
$dataProp = $this->_phpExcel->getProperties()->getLastModifiedBy(); $dataProp = $this->phpExcel->getProperties()->getLastModifiedBy();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x08), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x08),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x1E), // null-terminated string prepended by dword string length '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++; $dataSection_NumProps++;
} }
// Created Date/Time // Created Date/Time
if ($this->_phpExcel->getProperties()->getCreated()) { if ($this->phpExcel->getProperties()->getCreated()) {
$dataProp = $this->_phpExcel->getProperties()->getCreated(); $dataProp = $this->phpExcel->getProperties()->getCreated();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C),
'offset' => array('pack' => 'V'), '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) '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++; $dataSection_NumProps++;
} }
// Modified Date/Time // Modified Date/Time
if ($this->_phpExcel->getProperties()->getModified()) { if ($this->phpExcel->getProperties()->getModified()) {
$dataProp = $this->_phpExcel->getProperties()->getModified(); $dataProp = $this->phpExcel->getProperties()->getModified();
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D),
'offset' => array('pack' => 'V'), '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) 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)

View File

@ -82,7 +82,7 @@ class PHPExcel_Writer_Excel5_Escher
if ($dggContainer = $this->_object->getDggContainer()) { if ($dggContainer = $this->_object->getDggContainer()) {
$writer = new PHPExcel_Writer_Excel5_Escher($dggContainer); $writer = new PHPExcel_Writer_Excel5_Escher($dggContainer);
$this->_data = $writer->close(); $this->_data = $writer->close();
} else if ($dgContainer = $this->_object->getDgContainer()) { } elseif ($dgContainer = $this->_object->getDgContainer()) {
$writer = new PHPExcel_Writer_Excel5_Escher($dgContainer); $writer = new PHPExcel_Writer_Excel5_Escher($dgContainer);
$this->_data = $writer->close(); $this->_data = $writer->close();
$this->_spOffsets = $writer->getSpOffsets(); $this->_spOffsets = $writer->getSpOffsets();

View File

@ -83,7 +83,7 @@ class PHPExcel_Writer_Excel5_Font
$icv = $this->_colorIndex; // Index to color palette $icv = $this->_colorIndex; // Index to color palette
if ($this->_font->getSuperScript()) { if ($this->_font->getSuperScript()) {
$sss = 1; $sss = 1;
} else if ($this->_font->getSubScript()) { } elseif ($this->_font->getSubScript()) {
$sss = 2; $sss = 2;
} else { } else {
$sss = 0; $sss = 0;

View File

@ -610,7 +610,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
); );
// (exclusive) either repeatColumns or repeatRows // (exclusive) either repeatColumns or repeatRows
} else if ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) { } elseif ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) {
// Columns to repeat // Columns to repeat
if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { if ($sheetSetup->isColumnsToRepeatAtLeftSet()) {
$repeat = $sheetSetup->getColumnsToRepeatAtLeft(); $repeat = $sheetSetup->getColumnsToRepeatAtLeft();
@ -717,7 +717,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
$chunk .= $this->writeData($this->_writeDefinedNameBiff8(pack('C', 0x07), $formulaData, $i + 1, true)); $chunk .= $this->writeData($this->_writeDefinedNameBiff8(pack('C', 0x07), $formulaData, $i + 1, true));
// (exclusive) either repeatColumns or repeatRows // (exclusive) either repeatColumns or repeatRows
} else if ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) { } elseif ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) {
// Columns to repeat // Columns to repeat
if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { if ($sheetSetup->isColumnsToRepeatAtLeftSet()) {
$repeat = $sheetSetup->getColumnsToRepeatAtLeft(); $repeat = $sheetSetup->getColumnsToRepeatAtLeft();

View File

@ -504,7 +504,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
// internal to current workbook // internal to current workbook
$url = str_replace('sheet://', 'internal:', $url); $url = str_replace('sheet://', 'internal:', $url);
} else if (preg_match('/^(http:|https:|ftp:|mailto:)/', $url)) { } elseif (preg_match('/^(http:|https:|ftp:|mailto:)/', $url)) {
// URL // URL
// $url = $url; // $url = $url;
@ -3048,7 +3048,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) { if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) {
$type = 0x02; $type = 0x02;
$operatorType = 0x00; $operatorType = 0x00;
} else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) { } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS) {
$type = 0x01; $type = 0x01;
switch ($conditional->getOperatorType()) { switch ($conditional->getOperatorType()) {
@ -3089,7 +3089,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
$szValue2 = 0x0000; $szValue2 = 0x0000;
$operand1 = pack('Cv', 0x1E, $arrConditions[0]); $operand1 = pack('Cv', 0x1E, $arrConditions[0]);
$operand2 = null; $operand2 = null;
} else if ($numConditions == 2 && ($conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BETWEEN)) { } elseif ($numConditions == 2 && ($conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BETWEEN)) {
$szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000); $szValue1 = ($arrConditions[0] <= 65535 ? 3 : 0x0000);
$szValue2 = ($arrConditions[1] <= 65535 ? 3 : 0x0000); $szValue2 = ($arrConditions[1] <= 65535 ? 3 : 0x0000);
$operand1 = pack('Cv', 0x1E, $arrConditions[0]); $operand1 = pack('Cv', 0x1E, $arrConditions[0]);
@ -3226,7 +3226,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
if ($conditional->getStyle()->getFont()->getSubScript() == true) { if ($conditional->getStyle()->getFont()->getSubScript() == true) {
$dataBlockFont .= pack('v', 0x02); $dataBlockFont .= pack('v', 0x02);
$fontEscapement = 0; $fontEscapement = 0;
} else if ($conditional->getStyle()->getFont()->getSuperScript() == true) { } elseif ($conditional->getStyle()->getFont()->getSuperScript() == true) {
$dataBlockFont .= pack('v', 0x01); $dataBlockFont .= pack('v', 0x01);
$fontEscapement = 0; $fontEscapement = 0;
} else { } else {

View File

@ -75,61 +75,61 @@ class PHPExcel_Writer_Excel5_Xf
* *
* @var boolean * @var boolean
*/ */
private $_isStyleXf; private $isStyleXf;
/** /**
* Index to the FONT record. Index 4 does not exist * Index to the FONT record. Index 4 does not exist
* @var integer * @var integer
*/ */
private $_fontIndex; private $fontIndex;
/** /**
* An index (2 bytes) to a FORMAT record (number format). * An index (2 bytes) to a FORMAT record (number format).
* @var integer * @var integer
*/ */
public $_numberFormatIndex; private $numberFormatIndex;
/** /**
* 1 bit, apparently not used. * 1 bit, apparently not used.
* @var integer * @var integer
*/ */
public $_text_justlast; private $textJustLast;
/** /**
* The cell's foreground color. * The cell's foreground color.
* @var integer * @var integer
*/ */
public $_fg_color; private $foregroundColor;
/** /**
* The cell's background color. * The cell's background color.
* @var integer * @var integer
*/ */
public $_bg_color; private $backgroundColor;
/** /**
* Color of the bottom border of the cell. * Color of the bottom border of the cell.
* @var integer * @var integer
*/ */
public $_bottom_color; private $bottomBorderColor;
/** /**
* Color of the top border of the cell. * Color of the top border of the cell.
* @var integer * @var integer
*/ */
public $_top_color; private $topBorderColor;
/** /**
* Color of the left border of the cell. * Color of the left border of the cell.
* @var integer * @var integer
*/ */
public $_left_color; private $leftBorderColor;
/** /**
* Color of the right border of the cell. * Color of the right border of the cell.
* @var integer * @var integer
*/ */
public $_right_color; private $rightBorderColor;
/** /**
* Constructor * Constructor
@ -139,22 +139,22 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function __construct(PHPExcel_Style $style = null) public function __construct(PHPExcel_Style $style = null)
{ {
$this->_isStyleXf = false; $this->isStyleXf = false;
$this->_fontIndex = 0; $this->fontIndex = 0;
$this->_numberFormatIndex = 0; $this->numberFormatIndex = 0;
$this->_text_justlast = 0; $this->textJustLast = 0;
$this->_fg_color = 0x40; $this->foregroundColor = 0x40;
$this->_bg_color = 0x41; $this->backgroundColor = 0x41;
$this->_diag = 0; $this->_diag = 0;
$this->_bottom_color = 0x40; $this->bottomBorderColor = 0x40;
$this->_top_color = 0x40; $this->topBorderColor = 0x40;
$this->_left_color = 0x40; $this->leftBorderColor = 0x40;
$this->_right_color = 0x40; $this->rightBorderColor = 0x40;
$this->_diag_color = 0x40; $this->_diag_color = 0x40;
$this->_style = $style; $this->_style = $style;
@ -169,54 +169,54 @@ class PHPExcel_Writer_Excel5_Xf
public function writeXf() public function writeXf()
{ {
// Set the type of the XF record and some of the attributes. // Set the type of the XF record and some of the attributes.
if ($this->_isStyleXf) { if ($this->isStyleXf) {
$style = 0xFFF5; $style = 0xFFF5;
} else { } else {
$style = self::_mapLocked($this->_style->getProtection()->getLocked()); $style = self::mapLocked($this->_style->getProtection()->getLocked());
$style |= self::_mapHidden($this->_style->getProtection()->getHidden()) << 1; $style |= self::mapHidden($this->_style->getProtection()->getHidden()) << 1;
} }
// Flags to indicate if attributes have been set. // Flags to indicate if attributes have been set.
$atr_num = ($this->_numberFormatIndex != 0)?1:0; $atr_num = ($this->numberFormatIndex != 0)?1:0;
$atr_fnt = ($this->_fontIndex != 0)?1:0; $atr_fnt = ($this->fontIndex != 0)?1:0;
$atr_alc = ((int) $this->_style->getAlignment()->getWrapText()) ? 1 : 0; $atr_alc = ((int) $this->_style->getAlignment()->getWrapText()) ? 1 : 0;
$atr_bdr = (self::_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) || $atr_bdr = (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) ||
self::_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) || self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) ||
self::_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) || self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) ||
self::_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0; self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0;
$atr_pat = (($this->_fg_color != 0x40) || $atr_pat = (($this->foregroundColor != 0x40) ||
($this->_bg_color != 0x41) || ($this->backgroundColor != 0x41) ||
self::_mapFillType($this->_style->getFill()->getFillType()))?1:0; self::mapFillType($this->_style->getFill()->getFillType()))?1:0;
$atr_prot = self::_mapLocked($this->_style->getProtection()->getLocked()) $atr_prot = self::mapLocked($this->_style->getProtection()->getLocked())
| self::_mapHidden($this->_style->getProtection()->getHidden()); | self::mapHidden($this->_style->getProtection()->getHidden());
// Zero the default border colour if the border has not been set. // Zero the default border colour if the border has not been set.
if (self::_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0) { if (self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0) {
$this->_bottom_color = 0; $this->bottomBorderColor = 0;
} }
if (self::_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) { if (self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) {
$this->_top_color = 0; $this->topBorderColor = 0;
} }
if (self::_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0) { if (self::mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0) {
$this->_right_color = 0; $this->rightBorderColor = 0;
} }
if (self::_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) == 0) { if (self::mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) == 0) {
$this->_left_color = 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; $this->_diag_color = 0;
} }
$record = 0x00E0; // Record identifier $record = 0x00E0; // Record identifier
$length = 0x0014; // Number of bytes to follow $length = 0x0014; // Number of bytes to follow
$ifnt = $this->_fontIndex; // Index to FONT record $ifnt = $this->fontIndex; // Index to FONT record
$ifmt = $this->_numberFormatIndex; // Index to FORMAT 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 |= (int) $this->_style->getAlignment()->getWrapText() << 3;
$align |= self::_mapVAlign($this->_style->getAlignment()->getVertical()) << 4; $align |= self::mapVAlign($this->_style->getAlignment()->getVertical()) << 4;
$align |= $this->_text_justlast << 7; $align |= $this->textJustLast << 7;
$used_attrib = $atr_num << 2; $used_attrib = $atr_num << 2;
$used_attrib |= $atr_fnt << 3; $used_attrib |= $atr_fnt << 3;
@ -225,15 +225,15 @@ class PHPExcel_Writer_Excel5_Xf
$used_attrib |= $atr_pat << 6; $used_attrib |= $atr_pat << 6;
$used_attrib |= $atr_prot << 7; $used_attrib |= $atr_prot << 7;
$icv = $this->_fg_color; // fg and bg pattern colors $icv = $this->foregroundColor; // fg and bg pattern colors
$icv |= $this->_bg_color << 7; $icv |= $this->backgroundColor << 7;
$border1 = self::_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color $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()->getRight()->getBorderStyle()) << 4;
$border1 |= self::_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8; $border1 |= self::mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8;
$border1 |= self::_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12; $border1 |= self::mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12;
$border1 |= $this->_left_color << 16; $border1 |= $this->leftBorderColor << 16;
$border1 |= $this->_right_color << 23; $border1 |= $this->rightBorderColor << 23;
$diagonalDirection = $this->_style->getBorders()->getDiagonalDirection(); $diagonalDirection = $this->_style->getBorders()->getDiagonalDirection();
$diag_tl_to_rb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH $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_tl_to_rb << 30;
$border1 |= $diag_tr_to_lb << 31; $border1 |= $diag_tr_to_lb << 31;
$border2 = $this->_top_color; // Border color $border2 = $this->topBorderColor; // Border color
$border2 |= $this->_bottom_color << 7; $border2 |= $this->bottomBorderColor << 7;
$border2 |= $this->_diag_color << 14; $border2 |= $this->_diag_color << 14;
$border2 |= self::_mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21; $border2 |= self::mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21;
$border2 |= self::_mapFillType($this->_style->getFill()->getFillType()) << 26; $border2 |= self::mapFillType($this->_style->getFill()->getFillType()) << 26;
$header = pack("vv", $record, $length); $header = pack("vv", $record, $length);
@ -256,7 +256,7 @@ class PHPExcel_Writer_Excel5_Xf
$biff8_options |= (int) $this->_style->getAlignment()->getShrinkToFit() << 4; $biff8_options |= (int) $this->_style->getAlignment()->getShrinkToFit() << 4;
$data = pack("vvvC", $ifnt, $ifmt, $style, $align); $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); $data .= pack("VVv", $border1, $border2, $icv);
return($header . $data); return($header . $data);
@ -269,7 +269,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setIsStyleXf($value) public function setIsStyleXf($value)
{ {
$this->_isStyleXf = $value; $this->isStyleXf = $value;
} }
/** /**
@ -280,7 +280,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setBottomColor($colorIndex) public function setBottomColor($colorIndex)
{ {
$this->_bottom_color = $colorIndex; $this->bottomBorderColor = $colorIndex;
} }
/** /**
@ -291,7 +291,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setTopColor($colorIndex) public function setTopColor($colorIndex)
{ {
$this->_top_color = $colorIndex; $this->topBorderColor = $colorIndex;
} }
/** /**
@ -302,7 +302,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setLeftColor($colorIndex) public function setLeftColor($colorIndex)
{ {
$this->_left_color = $colorIndex; $this->leftBorderColor = $colorIndex;
} }
/** /**
@ -313,7 +313,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setRightColor($colorIndex) public function setRightColor($colorIndex)
{ {
$this->_right_color = $colorIndex; $this->rightBorderColor = $colorIndex;
} }
/** /**
@ -336,7 +336,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setFgColor($colorIndex) public function setFgColor($colorIndex)
{ {
$this->_fg_color = $colorIndex; $this->foregroundColor = $colorIndex;
} }
/** /**
@ -347,7 +347,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setBgColor($colorIndex) public function setBgColor($colorIndex)
{ {
$this->_bg_color = $colorIndex; $this->backgroundColor = $colorIndex;
} }
/** /**
@ -359,7 +359,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setNumberFormatIndex($numberFormatIndex) public function setNumberFormatIndex($numberFormatIndex)
{ {
$this->_numberFormatIndex = $numberFormatIndex; $this->numberFormatIndex = $numberFormatIndex;
} }
/** /**
@ -369,7 +369,7 @@ class PHPExcel_Writer_Excel5_Xf
*/ */
public function setFontIndex($value) public function setFontIndex($value)
{ {
$this->_fontIndex = $value; $this->fontIndex = $value;
} }
/** /**
@ -377,7 +377,8 @@ class PHPExcel_Writer_Excel5_Xf
* @static array of int * @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_THIN => 0x01,
PHPExcel_Style_Border::BORDER_MEDIUM => 0x02, PHPExcel_Style_Border::BORDER_MEDIUM => 0x02,
PHPExcel_Style_Border::BORDER_DASHED => 0x03, PHPExcel_Style_Border::BORDER_DASHED => 0x03,
@ -399,10 +400,10 @@ class PHPExcel_Writer_Excel5_Xf
* @param string $borderStyle * @param string $borderStyle
* @return int * @return int
*/ */
private static function _mapBorderStyle($borderStyle) private static function mapBorderStyle($borderStyle)
{ {
if (isset(self::$_mapBorderStyle[$borderStyle])) { if (isset(self::$mapBorderStyles[$borderStyle])) {
return self::$_mapBorderStyle[$borderStyle]; return self::$mapBorderStyles[$borderStyle];
} }
return 0x00; return 0x00;
} }
@ -412,7 +413,8 @@ class PHPExcel_Writer_Excel5_Xf
* @static array of int * @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_SOLID => 0x01,
PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY => 0x02, PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY => 0x02,
PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY => 0x03, 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_LINEAR => 0x00, // does not exist in BIFF8
PHPExcel_Style_Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8 PHPExcel_Style_Fill::FILL_GRADIENT_PATH => 0x00, // does not exist in BIFF8
); );
/** /**
* Map fill type * Map fill type
* *
* @param string $fillType * @param string $fillType
* @return int * @return int
*/ */
private static function _mapFillType($fillType) private static function mapFillType($fillType)
{ {
if (isset(self::$_mapFillType[$fillType])) { if (isset(self::$mapFillTypes[$fillType])) {
return self::$_mapFillType[$fillType]; return self::$mapFillTypes[$fillType];
} }
return 0x00; return 0x00;
} }
@ -453,7 +456,8 @@ class PHPExcel_Writer_Excel5_Xf
* @static array of int * @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_LEFT => 1,
PHPExcel_Style_Alignment::HORIZONTAL_CENTER => 2, PHPExcel_Style_Alignment::HORIZONTAL_CENTER => 2,
PHPExcel_Style_Alignment::HORIZONTAL_RIGHT => 3, 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_JUSTIFY => 5,
PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6, PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS => 6,
); );
/** /**
* Map to BIFF2-BIFF8 codes for horizontal alignment * Map to BIFF2-BIFF8 codes for horizontal alignment
* *
* @param string $hAlign * @param string $hAlign
* @return int * @return int
*/ */
private function _mapHAlign($hAlign) private function mapHAlign($hAlign)
{ {
if (isset(self::$_mapHAlign[$hAlign])) { if (isset(self::$mapHAlignments[$hAlign])) {
return self::$_mapHAlign[$hAlign]; return self::$mapHAlignments[$hAlign];
} }
return 0; return 0;
} }
@ -480,21 +485,23 @@ class PHPExcel_Writer_Excel5_Xf
* @static array of int * @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_CENTER => 1,
PHPExcel_Style_Alignment::VERTICAL_BOTTOM => 2, PHPExcel_Style_Alignment::VERTICAL_BOTTOM => 2,
PHPExcel_Style_Alignment::VERTICAL_JUSTIFY => 3, PHPExcel_Style_Alignment::VERTICAL_JUSTIFY => 3,
); );
/** /**
* Map to BIFF2-BIFF8 codes for vertical alignment * Map to BIFF2-BIFF8 codes for vertical alignment
* *
* @param string $vAlign * @param string $vAlign
* @return int * @return int
*/ */
private static function _mapVAlign($vAlign) private static function mapVAlign($vAlign)
{ {
if (isset(self::$_mapVAlign[$vAlign])) { if (isset(self::$mapVAlignments[$vAlign])) {
return self::$_mapVAlign[$vAlign]; return self::$mapVAlignments[$vAlign];
} }
return 2; return 2;
} }
@ -505,15 +512,13 @@ class PHPExcel_Writer_Excel5_Xf
* @param int $textRotation * @param int $textRotation
* @return int * @return int
*/ */
private static function _mapTextRotation($textRotation) private static function mapTextRotation($textRotation)
{ {
if ($textRotation >= 0) { if ($textRotation >= 0) {
return $textRotation; return $textRotation;
} } elseif ($textRotation == -165) {
if ($textRotation == -165) {
return 255; return 255;
} } elseif ($textRotation < 0) {
if ($textRotation < 0) {
return 90 - $textRotation; return 90 - $textRotation;
} }
} }
@ -524,7 +529,7 @@ class PHPExcel_Writer_Excel5_Xf
* @param string * @param string
* @return int * @return int
*/ */
private static function _mapLocked($locked) private static function mapLocked($locked)
{ {
switch ($locked) { switch ($locked) {
case PHPExcel_Style_Protection::PROTECTION_INHERIT: case PHPExcel_Style_Protection::PROTECTION_INHERIT:
@ -544,7 +549,7 @@ class PHPExcel_Writer_Excel5_Xf
* @param string * @param string
* @return int * @return int
*/ */
private static function _mapHidden($hidden) private static function mapHidden($hidden)
{ {
switch ($hidden) { switch ($hidden) {
case PHPExcel_Style_Protection::PROTECTION_INHERIT: case PHPExcel_Style_Protection::PROTECTION_INHERIT:

View File

@ -32,14 +32,14 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
* *
* @var string * @var string
*/ */
protected $_tempDir = ''; protected $tempDir = '';
/** /**
* Font * Font
* *
* @var string * @var string
*/ */
protected $_font = 'freesans'; protected $font = 'freesans';
/** /**
* Orientation (Over-ride) * Orientation (Over-ride)
@ -212,7 +212,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
{ {
parent::__construct($phpExcel); parent::__construct($phpExcel);
$this->setUseInlineCss(true); $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() 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) public function setFont($fontName)
{ {
$this->_font = $fontName; $this->font = $fontName;
return $this; return $this;
} }
@ -291,7 +291,7 @@ abstract class PHPExcel_Writer_PDF_Core extends PHPExcel_Writer_HTML
*/ */
public function getTempDir() 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 = '') public function setTempDir($pValue = '')
{ {
if (is_dir($pValue)) { if (is_dir($pValue)) {
$this->_tempDir = $pValue; $this->tempDir = $pValue;
} else { } else {
throw new PHPExcel_Writer_Exception("Directory does not exist: $pValue"); throw new PHPExcel_Writer_Exception("Directory does not exist: $pValue");
} }