Eliminate some code duplication

This commit is contained in:
Mark Baker 2013-02-11 14:11:36 +00:00
parent abb076a817
commit f05f66fa82
3 changed files with 227 additions and 220 deletions

File diff suppressed because it is too large Load Diff

View File

@ -288,7 +288,10 @@ class PHPExcel_Cell
if ($this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) { if ($this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
try { try {
// echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value<br />'; // echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value<br />';
$result = $this->getParent()->getParent()->getCalculationEngine()->calculateCellValue($this,$resetLog); $result = PHPExcel_Calculation::getInstance(
$this->getParent()->getParent()
)->calculateCellValue($this,$resetLog);
// $result = $this->getParent()->getParent()->getCalculationEngine()->calculateCellValue($this,$resetLog);
// echo $this->getCoordinate().' calculation result is '.$result.'<br />'; // echo $this->getCoordinate().' calculation result is '.$result.'<br />';
} catch ( PHPExcel_Exception $ex ) { } catch ( PHPExcel_Exception $ex ) {
if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->_calculatedValue !== NULL)) { if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->_calculatedValue !== NULL)) {

View File

@ -279,7 +279,7 @@ class PHPExcel_Chart_DataSeriesValues
public function refresh(PHPExcel_Worksheet $worksheet, $flatten = TRUE) { public function refresh(PHPExcel_Worksheet $worksheet, $flatten = TRUE) {
if ($this->_dataSource !== NULL) { if ($this->_dataSource !== NULL) {
$calcEngine = PHPExcel_Calculation::getInstance(); $calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent());
$newDataValues = PHPExcel_Calculation::_unwrapResult( $newDataValues = PHPExcel_Calculation::_unwrapResult(
$calcEngine->_calculateFormulaValue( $calcEngine->_calculateFormulaValue(
'='.$this->_dataSource, '='.$this->_dataSource,