From b18939b29d60dea693c8854e5e28571c4b765421 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Tue, 14 Feb 2012 13:48:09 +0000 Subject: [PATCH] Minor fixes for strict standards git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@86471 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Calculation.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Classes/PHPExcel/Calculation.php b/Classes/PHPExcel/Calculation.php index 791cad7..4f0355d 100644 --- a/Classes/PHPExcel/Calculation.php +++ b/Classes/PHPExcel/Calculation.php @@ -2517,7 +2517,7 @@ class PHPExcel_Calculation { return ($value) ? self::$_localeBoolean['TRUE'] : self::$_localeBoolean['FALSE']; } } - return $value; + return PHPExcel_Calculation_Functions::flattenSingleValue($value); } // function _showValue() @@ -2977,7 +2977,8 @@ class PHPExcel_Calculation { } while (($op = $stack->pop()) !== NULL) { // pop everything off the stack and push onto output - if ($opCharacter['value'] == '(') return $this->_raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced + if ((is_array($opCharacter) && $opCharacter['value'] == '(') || ($opCharacter === '(')) + return $this->_raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced $output[] = $op; } return $output; @@ -3008,16 +3009,20 @@ class PHPExcel_Calculation { $operand1 = $operand1Data['value']; if (($operand1Data['reference'] === NULL) && (is_array($operand1))) { - $rowKey = array_shift(array_keys($operand1)); - $colKey = array_shift(array_keys($operand1[$rowKey])); + $rKeys = array_keys($operand1); + $rowKey = array_shift($rKeys); + $cKeys = array_keys(array_keys($operand1[$rowKey])); + $colKey = array_shift($cKeys); if (ctype_upper($colKey)) { $operand1Data['reference'] = $colKey.$rowKey; } } $operand2 = $operand2Data['value']; if (($operand2Data['reference'] === NULL) && (is_array($operand2))) { - $rowKey = array_shift(array_keys($operand2)); - $colKey = array_shift(array_keys($operand2[$rowKey])); + $rKeys = array_keys($operand2); + $rowKey = array_shift($rKeys); + $cKeys = array_keys(array_keys($operand1[$rowKey])); + $colKey = array_shift($cKeys); if (ctype_upper($colKey)) { $operand2Data['reference'] = $colKey.$rowKey; }