Delete debug and commented out code
This commit is contained in:
		
							parent
							
								
									f917b3b1f4
								
							
						
					
					
						commit
						91417ad1c3
					
				| @ -18,8 +18,6 @@ if (!defined('CALCULATION_REGEXP_CELLREF')) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Calculation (Multiton) |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -3099,34 +3097,25 @@ class Calculation | |||||||
|         //    The guts of the lexical parser
 |         //    The guts of the lexical parser
 | ||||||
|         //    Loop through the formula extracting each operator and operand in turn
 |         //    Loop through the formula extracting each operator and operand in turn
 | ||||||
|         while (true) { |         while (true) { | ||||||
|             //echo 'Assessing Expression '.substr($formula, $index), PHP_EOL;
 |  | ||||||
|             $opCharacter = $formula{$index};    //    Get the first character of the value at the current index position
 |             $opCharacter = $formula{$index};    //    Get the first character of the value at the current index position
 | ||||||
| //echo 'Initial character of expression block is '.$opCharacter, PHP_EOL;
 |  | ||||||
|             if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula{$index + 1}]))) { |             if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula{$index + 1}]))) { | ||||||
|                 $opCharacter .= $formula{++$index}; |                 $opCharacter .= $formula{++$index}; | ||||||
| //echo 'Initial character of expression block is comparison operator '.$opCharacter.PHP_EOL;
 |  | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             //    Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand
 |             //    Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand
 | ||||||
|             $isOperandOrFunction = preg_match($regexpMatchString, substr($formula, $index), $match); |             $isOperandOrFunction = preg_match($regexpMatchString, substr($formula, $index), $match); | ||||||
| //echo '$isOperandOrFunction is '.(($isOperandOrFunction) ? 'True' : 'False').PHP_EOL;
 |  | ||||||
| //var_dump($match);
 |  | ||||||
| 
 | 
 | ||||||
|             if ($opCharacter == '-' && !$expectingOperator) {                //    Is it a negation instead of a minus?
 |             if ($opCharacter == '-' && !$expectingOperator) {                //    Is it a negation instead of a minus?
 | ||||||
| //echo 'Element is a Negation operator', PHP_EOL;
 |  | ||||||
|                 $stack->push('Unary Operator', '~'); //    Put a negation on the stack
 |                 $stack->push('Unary Operator', '~'); //    Put a negation on the stack
 | ||||||
|                 ++$index; //        and drop the negation symbol
 |                 ++$index; //        and drop the negation symbol
 | ||||||
|             } elseif ($opCharacter == '%' && $expectingOperator) { |             } elseif ($opCharacter == '%' && $expectingOperator) { | ||||||
|                 //echo 'Element is a Percentage operator', PHP_EOL;
 |  | ||||||
|                 $stack->push('Unary Operator', '%'); //    Put a percentage on the stack
 |                 $stack->push('Unary Operator', '%'); //    Put a percentage on the stack
 | ||||||
|                 ++$index; |                 ++$index; | ||||||
|             } elseif ($opCharacter == '+' && !$expectingOperator) {            //    Positive (unary plus rather than binary operator plus) can be discarded?
 |             } elseif ($opCharacter == '+' && !$expectingOperator) {            //    Positive (unary plus rather than binary operator plus) can be discarded?
 | ||||||
| //echo 'Element is a Positive number, not Plus operator', PHP_EOL;
 |  | ||||||
|                 ++$index; //    Drop the redundant plus symbol
 |                 ++$index; //    Drop the redundant plus symbol
 | ||||||
|             } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) {    //    We have to explicitly deny a tilde or pipe, because they are legal
 |             } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) {    //    We have to explicitly deny a tilde or pipe, because they are legal
 | ||||||
|                 return $this->raiseFormulaError("Formula Error: Illegal character '~'"); //        on the stack but not in the input expression
 |                 return $this->raiseFormulaError("Formula Error: Illegal character '~'"); //        on the stack but not in the input expression
 | ||||||
|             } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) {    //    Are we putting an operator on the stack?
 |             } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) {    //    Are we putting an operator on the stack?
 | ||||||
| //echo 'Element with value '.$opCharacter.' is an Operator', PHP_EOL;
 |  | ||||||
|                 while ($stack->count() > 0 && |                 while ($stack->count() > 0 && | ||||||
|                     ($o2 = $stack->last()) && |                     ($o2 = $stack->last()) && | ||||||
|                     isset(self::$operators[$o2['value']]) && |                     isset(self::$operators[$o2['value']]) && | ||||||
| @ -3137,7 +3126,6 @@ class Calculation | |||||||
|                 ++$index; |                 ++$index; | ||||||
|                 $expectingOperator = false; |                 $expectingOperator = false; | ||||||
|             } elseif ($opCharacter == ')' && $expectingOperator) {            //    Are we expecting to close a parenthesis?
 |             } elseif ($opCharacter == ')' && $expectingOperator) {            //    Are we expecting to close a parenthesis?
 | ||||||
| //echo 'Element is a Closing bracket', PHP_EOL;
 |  | ||||||
|                 $expectingOperand = false; |                 $expectingOperand = false; | ||||||
|                 while (($o2 = $stack->pop()) && $o2['value'] != '(') {        //    Pop off the stack back to the last (
 |                 while (($o2 = $stack->pop()) && $o2['value'] != '(') {        //    Pop off the stack back to the last (
 | ||||||
|                     if ($o2 === null) { |                     if ($o2 === null) { | ||||||
| @ -3149,24 +3137,14 @@ class Calculation | |||||||
|                 $d = $stack->last(2); |                 $d = $stack->last(2); | ||||||
|                 if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) {    //    Did this parenthesis just close a function?
 |                 if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) {    //    Did this parenthesis just close a function?
 | ||||||
|                     $functionName = $matches[1]; //    Get the function name
 |                     $functionName = $matches[1]; //    Get the function name
 | ||||||
| //echo 'Closed Function is '.$functionName, PHP_EOL;
 |  | ||||||
|                     $d = $stack->pop(); |                     $d = $stack->pop(); | ||||||
|                     $argumentCount = $d['value']; //    See how many arguments there were (argument count is the next value stored on the stack)
 |                     $argumentCount = $d['value']; //    See how many arguments there were (argument count is the next value stored on the stack)
 | ||||||
| //if ($argumentCount == 0) {
 |  | ||||||
| //    echo 'With no arguments', PHP_EOL;
 |  | ||||||
| //} elseif ($argumentCount == 1) {
 |  | ||||||
| //    echo 'With 1 argument', PHP_EOL;
 |  | ||||||
| //} else {
 |  | ||||||
| //    echo 'With '.$argumentCount.' arguments', PHP_EOL;
 |  | ||||||
| //}
 |  | ||||||
|                     $output[] = $d; //    Dump the argument count on the output
 |                     $output[] = $d; //    Dump the argument count on the output
 | ||||||
|                     $output[] = $stack->pop(); //    Pop the function and push onto the output
 |                     $output[] = $stack->pop(); //    Pop the function and push onto the output
 | ||||||
|                     if (isset(self::$controlFunctions[$functionName])) { |                     if (isset(self::$controlFunctions[$functionName])) { | ||||||
|                         //echo 'Built-in function '.$functionName, PHP_EOL;
 |  | ||||||
|                         $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount']; |                         $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount']; | ||||||
|                         $functionCall = self::$controlFunctions[$functionName]['functionCall']; |                         $functionCall = self::$controlFunctions[$functionName]['functionCall']; | ||||||
|                     } elseif (isset(self::$phpSpreadsheetFunctions[$functionName])) { |                     } elseif (isset(self::$phpSpreadsheetFunctions[$functionName])) { | ||||||
|                         //echo 'PhpSpreadsheet function '.$functionName, PHP_EOL;
 |  | ||||||
|                         $expectedArgumentCount = self::$phpSpreadsheetFunctions[$functionName]['argumentCount']; |                         $expectedArgumentCount = self::$phpSpreadsheetFunctions[$functionName]['argumentCount']; | ||||||
|                         $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall']; |                         $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall']; | ||||||
|                     } else {    // did we somehow push a non-function on the stack? this should never happen
 |                     } else {    // did we somehow push a non-function on the stack? this should never happen
 | ||||||
| @ -3176,13 +3154,11 @@ class Calculation | |||||||
|                     $argumentCountError = false; |                     $argumentCountError = false; | ||||||
|                     if (is_numeric($expectedArgumentCount)) { |                     if (is_numeric($expectedArgumentCount)) { | ||||||
|                         if ($expectedArgumentCount < 0) { |                         if ($expectedArgumentCount < 0) { | ||||||
|                             //echo '$expectedArgumentCount is between 0 and '.abs($expectedArgumentCount), PHP_EOL;
 |  | ||||||
|                             if ($argumentCount > abs($expectedArgumentCount)) { |                             if ($argumentCount > abs($expectedArgumentCount)) { | ||||||
|                                 $argumentCountError = true; |                                 $argumentCountError = true; | ||||||
|                                 $expectedArgumentCountString = 'no more than ' . abs($expectedArgumentCount); |                                 $expectedArgumentCountString = 'no more than ' . abs($expectedArgumentCount); | ||||||
|                             } |                             } | ||||||
|                         } else { |                         } else { | ||||||
|                             //echo '$expectedArgumentCount is numeric '.$expectedArgumentCount, PHP_EOL;
 |  | ||||||
|                             if ($argumentCount != $expectedArgumentCount) { |                             if ($argumentCount != $expectedArgumentCount) { | ||||||
|                                 $argumentCountError = true; |                                 $argumentCountError = true; | ||||||
|                                 $expectedArgumentCountString = $expectedArgumentCount; |                                 $expectedArgumentCountString = $expectedArgumentCount; | ||||||
| @ -3190,8 +3166,6 @@ class Calculation | |||||||
|                         } |                         } | ||||||
|                     } elseif ($expectedArgumentCount != '*') { |                     } elseif ($expectedArgumentCount != '*') { | ||||||
|                         $isOperandOrFunction = preg_match('/(\d*)([-+,])(\d*)/', $expectedArgumentCount, $argMatch); |                         $isOperandOrFunction = preg_match('/(\d*)([-+,])(\d*)/', $expectedArgumentCount, $argMatch); | ||||||
| //print_r($argMatch);
 |  | ||||||
| //echo PHP_EOL;
 |  | ||||||
|                         switch ($argMatch[2]) { |                         switch ($argMatch[2]) { | ||||||
|                             case '+': |                             case '+': | ||||||
|                                 if ($argumentCount < $argMatch[1]) { |                                 if ($argumentCount < $argMatch[1]) { | ||||||
| @ -3219,7 +3193,6 @@ class Calculation | |||||||
|                 } |                 } | ||||||
|                 ++$index; |                 ++$index; | ||||||
|             } elseif ($opCharacter == ',') {            //    Is this the separator for function arguments?
 |             } elseif ($opCharacter == ',') {            //    Is this the separator for function arguments?
 | ||||||
| //echo 'Element is a Function argument separator', PHP_EOL;
 |  | ||||||
|                 while (($o2 = $stack->pop()) && $o2['value'] != '(') {        //    Pop off the stack back to the last (
 |                 while (($o2 = $stack->pop()) && $o2['value'] != '(') {        //    Pop off the stack back to the last (
 | ||||||
|                     if ($o2 === null) { |                     if ($o2 === null) { | ||||||
|                         return $this->raiseFormulaError('Formula Error: Unexpected ,'); |                         return $this->raiseFormulaError('Formula Error: Unexpected ,'); | ||||||
| @ -3244,7 +3217,6 @@ class Calculation | |||||||
|                 $expectingOperand = true; |                 $expectingOperand = true; | ||||||
|                 ++$index; |                 ++$index; | ||||||
|             } elseif ($opCharacter == '(' && !$expectingOperator) { |             } elseif ($opCharacter == '(' && !$expectingOperator) { | ||||||
|                 //                echo 'Element is an Opening Bracket<br />';
 |  | ||||||
|                 $stack->push('Brace', '('); |                 $stack->push('Brace', '('); | ||||||
|                 ++$index; |                 ++$index; | ||||||
|             } elseif ($isOperandOrFunction && !$expectingOperator) {    // do we now have a function/variable/number?
 |             } elseif ($isOperandOrFunction && !$expectingOperator) {    // do we now have a function/variable/number?
 | ||||||
| @ -3252,11 +3224,9 @@ class Calculation | |||||||
|                 $expectingOperand = false; |                 $expectingOperand = false; | ||||||
|                 $val = $match[1]; |                 $val = $match[1]; | ||||||
|                 $length = strlen($val); |                 $length = strlen($val); | ||||||
| //                echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function<br />';
 |  | ||||||
| 
 | 
 | ||||||
|                 if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $val, $matches)) { |                 if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $val, $matches)) { | ||||||
|                     $val = preg_replace('/\s/u', '', $val); |                     $val = preg_replace('/\s/u', '', $val); | ||||||
| //                    echo 'Element '.$val.' is a Function<br />';
 |  | ||||||
|                     if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) {    // it's a function
 |                     if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) {    // it's a function
 | ||||||
|                         $stack->push('Function', strtoupper($val)); |                         $stack->push('Function', strtoupper($val)); | ||||||
|                         $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index + $length), $amatch); |                         $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index + $length), $amatch); | ||||||
| @ -3272,7 +3242,6 @@ class Calculation | |||||||
|                         $output[] = ['type' => 'Value', 'value' => $matches[1], 'reference' => null]; |                         $output[] = ['type' => 'Value', 'value' => $matches[1], 'reference' => null]; | ||||||
|                     } |                     } | ||||||
|                 } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $val, $matches)) { |                 } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $val, $matches)) { | ||||||
|                     //                    echo 'Element '.$val.' is a Cell reference<br />';
 |  | ||||||
|                     //    Watch for this case-change when modifying to allow cell references in different worksheets...
 |                     //    Watch for this case-change when modifying to allow cell references in different worksheets...
 | ||||||
|                     //    Should only be applied to the actual cell column, not the worksheet name
 |                     //    Should only be applied to the actual cell column, not the worksheet name
 | ||||||
| 
 | 
 | ||||||
| @ -3294,9 +3263,7 @@ class Calculation | |||||||
|                     } |                     } | ||||||
| 
 | 
 | ||||||
|                     $output[] = ['type' => 'Cell Reference', 'value' => $val, 'reference' => $val]; |                     $output[] = ['type' => 'Cell Reference', 'value' => $val, 'reference' => $val]; | ||||||
| //                    $expectingOperator = FALSE;
 |  | ||||||
|                 } else {    // it's a variable, constant, string, number or boolean
 |                 } else {    // it's a variable, constant, string, number or boolean
 | ||||||
| //                    echo 'Element is a Variable, Constant, String, Number or Boolean<br />';
 |  | ||||||
|                     //    If the last entry on the stack was a : operator, then we may have a row or column range reference
 |                     //    If the last entry on the stack was a : operator, then we may have a row or column range reference
 | ||||||
|                     $testPrevOp = $stack->last(1); |                     $testPrevOp = $stack->last(1); | ||||||
|                     if ($testPrevOp['value'] == ':') { |                     if ($testPrevOp['value'] == ':') { | ||||||
| @ -3332,24 +3299,18 @@ class Calculation | |||||||
| 
 | 
 | ||||||
|                     $localeConstant = false; |                     $localeConstant = false; | ||||||
|                     if ($opCharacter == '"') { |                     if ($opCharacter == '"') { | ||||||
|                         //                        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 />';
 |  | ||||||
|                         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)) { | ||||||
|                             //                            echo 'Casting '.$val.' to float<br />';
 |  | ||||||
|                             $val = (float) $val; |                             $val = (float) $val; | ||||||
|                         } else { |                         } else { | ||||||
|                             //                            echo 'Casting '.$val.' to integer<br />';
 |  | ||||||
|                             $val = (integer) $val; |                             $val = (integer) $val; | ||||||
|                         } |                         } | ||||||
|                     } elseif (isset(self::$excelConstants[trim(strtoupper($val))])) { |                     } elseif (isset(self::$excelConstants[trim(strtoupper($val))])) { | ||||||
|                         $excelConstant = trim(strtoupper($val)); |                         $excelConstant = trim(strtoupper($val)); | ||||||
| //                        echo 'Element '.$excelConstant.' is an Excel Constant<br />';
 |  | ||||||
|                         $val = self::$excelConstants[$excelConstant]; |                         $val = self::$excelConstants[$excelConstant]; | ||||||
|                     } elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$localeBoolean)) !== false) { |                     } elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$localeBoolean)) !== false) { | ||||||
|                         //                        echo 'Element '.$localeConstant.' is an Excel Constant<br />';
 |  | ||||||
|                         $val = self::$excelConstants[$localeConstant]; |                         $val = self::$excelConstants[$localeConstant]; | ||||||
|                     } |                     } | ||||||
|                     $details = ['type' => 'Value', 'value' => $val, 'reference' => null]; |                     $details = ['type' => 'Value', 'value' => $val, 'reference' => null]; | ||||||
| @ -3394,10 +3355,8 @@ class Calculation | |||||||
|                 } |                 } | ||||||
|                 //    If we're expecting an operator, but only have a space between the previous and next operands (and both are
 |                 //    If we're expecting an operator, but only have a space between the previous and next operands (and both are
 | ||||||
|                 //        Cell References) then we have an INTERSECTION operator
 |                 //        Cell References) then we have an INTERSECTION operator
 | ||||||
| //                echo 'Possible Intersect Operator<br />';
 |  | ||||||
|                 if (($expectingOperator) && (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '.*/Ui', substr($formula, $index), $match)) && |                 if (($expectingOperator) && (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '.*/Ui', substr($formula, $index), $match)) && | ||||||
|                     ($output[count($output) - 1]['type'] == 'Cell Reference')) { |                     ($output[count($output) - 1]['type'] == 'Cell Reference')) { | ||||||
|                     //                    echo 'Element is an Intersect Operator<br />';
 |  | ||||||
|                     while ($stack->count() > 0 && |                     while ($stack->count() > 0 && | ||||||
|                         ($o2 = $stack->last()) && |                         ($o2 = $stack->last()) && | ||||||
|                         isset(self::$operators[$o2['value']]) && |                         isset(self::$operators[$o2['value']]) && | ||||||
| @ -3455,13 +3414,9 @@ class Calculation | |||||||
| 
 | 
 | ||||||
|         //    Loop through each token in turn
 |         //    Loop through each token in turn
 | ||||||
|         foreach ($tokens as $tokenData) { |         foreach ($tokens as $tokenData) { | ||||||
|             //            print_r($tokenData);
 |  | ||||||
| //            echo '<br />';
 |  | ||||||
|             $token = $tokenData['value']; |             $token = $tokenData['value']; | ||||||
| //            echo '<b>Token is '.$token.'</b><br />';
 |  | ||||||
|             // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
 |             // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
 | ||||||
|             if (isset(self::$binaryOperators[$token])) { |             if (isset(self::$binaryOperators[$token])) { | ||||||
|                 //                echo 'Token is a binary operator<br />';
 |  | ||||||
|                 //    We must have two operands, error if we don't
 |                 //    We must have two operands, error if we don't
 | ||||||
|                 if (($operand2Data = $stack->pop()) === null) { |                 if (($operand2Data = $stack->pop()) === null) { | ||||||
|                     return $this->raiseFormulaError('Internal error - Operand value missing from stack'); |                     return $this->raiseFormulaError('Internal error - Operand value missing from stack'); | ||||||
| @ -3604,17 +3559,14 @@ class Calculation | |||||||
| 
 | 
 | ||||||
|             // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on
 |             // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on
 | ||||||
|             } elseif (($token === '~') || ($token === '%')) { |             } elseif (($token === '~') || ($token === '%')) { | ||||||
|                 //                echo 'Token is a unary operator<br />';
 |  | ||||||
|                 if (($arg = $stack->pop()) === null) { |                 if (($arg = $stack->pop()) === null) { | ||||||
|                     return $this->raiseFormulaError('Internal error - Operand value missing from stack'); |                     return $this->raiseFormulaError('Internal error - Operand value missing from stack'); | ||||||
|                 } |                 } | ||||||
|                 $arg = $arg['value']; |                 $arg = $arg['value']; | ||||||
|                 if ($token === '~') { |                 if ($token === '~') { | ||||||
|                     //                    echo 'Token is a negation operator<br />';
 |  | ||||||
|                     $this->_debugLog->writeDebugLog('Evaluating Negation of ', $this->showValue($arg)); |                     $this->_debugLog->writeDebugLog('Evaluating Negation of ', $this->showValue($arg)); | ||||||
|                     $multiplier = -1; |                     $multiplier = -1; | ||||||
|                 } else { |                 } else { | ||||||
|                     //                    echo 'Token is a percentile operator<br />';
 |  | ||||||
|                     $this->_debugLog->writeDebugLog('Evaluating Percentile of ', $this->showValue($arg)); |                     $this->_debugLog->writeDebugLog('Evaluating Percentile of ', $this->showValue($arg)); | ||||||
|                     $multiplier = 0.01; |                     $multiplier = 0.01; | ||||||
|                 } |                 } | ||||||
| @ -3635,9 +3587,7 @@ class Calculation | |||||||
|                 } |                 } | ||||||
|             } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $token, $matches)) { |             } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $token, $matches)) { | ||||||
|                 $cellRef = null; |                 $cellRef = null; | ||||||
| //                echo 'Element '.$token.' is a Cell reference<br />';
 |  | ||||||
|                 if (isset($matches[8])) { |                 if (isset($matches[8])) { | ||||||
|                     //                    echo 'Reference is a Range of cells<br />';
 |  | ||||||
|                     if ($pCell === null) { |                     if ($pCell === null) { | ||||||
|                         //                        We can't access the range, so return a REF error
 |                         //                        We can't access the range, so return a REF error
 | ||||||
|                         $cellValue = Calculation\Functions::REF(); |                         $cellValue = Calculation\Functions::REF(); | ||||||
| @ -3650,7 +3600,6 @@ class Calculation | |||||||
|                                 return $this->raiseFormulaError('Unable to access External Workbook'); |                                 return $this->raiseFormulaError('Unable to access External Workbook'); | ||||||
|                             } |                             } | ||||||
|                             $matches[2] = trim($matches[2], "\"'"); |                             $matches[2] = trim($matches[2], "\"'"); | ||||||
| //                            echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'<br />';
 |  | ||||||
|                             $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in worksheet ', $matches[2]); |                             $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in worksheet ', $matches[2]); | ||||||
|                             if ($pCellParent !== null) { |                             if ($pCellParent !== null) { | ||||||
|                                 $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false); |                                 $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false); | ||||||
| @ -3658,9 +3607,7 @@ class Calculation | |||||||
|                                 return $this->raiseFormulaError('Unable to access Cell Reference'); |                                 return $this->raiseFormulaError('Unable to access Cell Reference'); | ||||||
|                             } |                             } | ||||||
|                             $this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue)); |                             $this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue)); | ||||||
| //                            $cellRef = $matches[2].'!'.$cellRef;
 |  | ||||||
|                         } else { |                         } else { | ||||||
|                             //                            echo '$cellRef='.$cellRef.' in current worksheet<br />';
 |  | ||||||
|                             $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in current worksheet'); |                             $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in current worksheet'); | ||||||
|                             if ($pCellParent !== null) { |                             if ($pCellParent !== null) { | ||||||
|                                 $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false); |                                 $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false); | ||||||
| @ -3671,7 +3618,6 @@ class Calculation | |||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 } else { |                 } else { | ||||||
|                     //                    echo 'Reference is a single Cell<br />';
 |  | ||||||
|                     if ($pCell === null) { |                     if ($pCell === null) { | ||||||
|                         //                        We can't access the cell, so return a REF error
 |                         //                        We can't access the cell, so return a REF error
 | ||||||
|                         $cellValue = Calculation\Functions::REF(); |                         $cellValue = Calculation\Functions::REF(); | ||||||
| @ -3683,7 +3629,6 @@ class Calculation | |||||||
|                                 //    It's a Reference to an external spreadsheet (not currently supported)
 |                                 //    It's a Reference to an external spreadsheet (not currently supported)
 | ||||||
|                                 return $this->raiseFormulaError('Unable to access External Workbook'); |                                 return $this->raiseFormulaError('Unable to access External Workbook'); | ||||||
|                             } |                             } | ||||||
| //                            echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'<br />';
 |  | ||||||
|                             $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in worksheet ', $matches[2]); |                             $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in worksheet ', $matches[2]); | ||||||
|                             if ($pCellParent !== null) { |                             if ($pCellParent !== null) { | ||||||
|                                 $cellSheet = $this->spreadsheet->getSheetByName($matches[2]); |                                 $cellSheet = $this->spreadsheet->getSheetByName($matches[2]); | ||||||
| @ -3697,9 +3642,7 @@ class Calculation | |||||||
|                                 return $this->raiseFormulaError('Unable to access Cell Reference'); |                                 return $this->raiseFormulaError('Unable to access Cell Reference'); | ||||||
|                             } |                             } | ||||||
|                             $this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue)); |                             $this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue)); | ||||||
| //                            $cellRef = $matches[2].'!'.$cellRef;
 |  | ||||||
|                         } else { |                         } else { | ||||||
|                             //                            echo '$cellRef='.$cellRef.' in current worksheet<br />';
 |  | ||||||
|                             $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in current worksheet'); |                             $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in current worksheet'); | ||||||
|                             if ($pCellParent->isDataSet($cellRef)) { |                             if ($pCellParent->isDataSet($cellRef)) { | ||||||
|                                 $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false); |                                 $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false); | ||||||
| @ -3715,7 +3658,6 @@ class Calculation | |||||||
| 
 | 
 | ||||||
|             // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
 |             // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
 | ||||||
|             } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $token, $matches)) { |             } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $token, $matches)) { | ||||||
|                 //                echo 'Token is a function<br />';
 |  | ||||||
|                 $functionName = $matches[1]; |                 $functionName = $matches[1]; | ||||||
|                 $argCount = $stack->pop(); |                 $argCount = $stack->pop(); | ||||||
|                 $argCount = $argCount['value']; |                 $argCount = $argCount['value']; | ||||||
| @ -3733,7 +3675,6 @@ class Calculation | |||||||
|                         $passCellReference = isset(self::$controlFunctions[$functionName]['passCellReference']); |                         $passCellReference = isset(self::$controlFunctions[$functionName]['passCellReference']); | ||||||
|                     } |                     } | ||||||
|                     // get the arguments for this function
 |                     // get the arguments for this function
 | ||||||
| //                    echo 'Function '.$functionName.' expects '.$argCount.' arguments<br />';
 |  | ||||||
|                     $args = $argArrayVals = []; |                     $args = $argArrayVals = []; | ||||||
|                     for ($i = 0; $i < $argCount; ++$i) { |                     for ($i = 0; $i < $argCount; ++$i) { | ||||||
|                         $arg = $stack->pop(); |                         $arg = $stack->pop(); | ||||||
| @ -3765,38 +3706,14 @@ class Calculation | |||||||
|                         $args[] = $cellID; |                         $args[] = $cellID; | ||||||
|                         $argArrayVals[] = $this->showValue($cellID); |                         $argArrayVals[] = $this->showValue($cellID); | ||||||
|                     } |                     } | ||||||
| //                    echo 'Arguments are: ';
 | 
 | ||||||
| //                    print_r($args);
 |  | ||||||
| //                    echo '<br />';
 |  | ||||||
|                     if ($functionName != 'MKMATRIX') { |                     if ($functionName != 'MKMATRIX') { | ||||||
|                         if ($this->_debugLog->getWriteDebugLog()) { |                         if ($this->_debugLog->getWriteDebugLog()) { | ||||||
|                             krsort($argArrayVals); |                             krsort($argArrayVals); | ||||||
|                             $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator . ' ', Calculation\Functions::flattenArray($argArrayVals)), ' )'); |                             $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator . ' ', Calculation\Functions::flattenArray($argArrayVals)), ' )'); | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     //    Process each argument in turn, building the return value as an array
 | 
 | ||||||
| //                    if (($argCount == 1) && (is_array($args[1])) && ($functionName != 'MKMATRIX')) {
 |  | ||||||
| //                        $operand1 = $args[1];
 |  | ||||||
| //                        $this->_debugLog->writeDebugLog('Argument is a matrix: ', $this->showValue($operand1));
 |  | ||||||
| //                        $result = array();
 |  | ||||||
| //                        $row = 0;
 |  | ||||||
| //                        foreach($operand1 as $args) {
 |  | ||||||
| //                            if (is_array($args)) {
 |  | ||||||
| //                                foreach($args as $arg) {
 |  | ||||||
| //                                    $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', $this->showValue($arg), ' )');
 |  | ||||||
| //                                    $r = call_user_func_array($functionCall, $arg);
 |  | ||||||
| //                                    $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($r));
 |  | ||||||
| //                                    $result[$row][] = $r;
 |  | ||||||
| //                                }
 |  | ||||||
| //                                ++$row;
 |  | ||||||
| //                            } else {
 |  | ||||||
| //                                $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', $this->showValue($args), ' )');
 |  | ||||||
| //                                $r = call_user_func_array($functionCall, $args);
 |  | ||||||
| //                                $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($r));
 |  | ||||||
| //                                $result[] = $r;
 |  | ||||||
| //                            }
 |  | ||||||
| //                        }
 |  | ||||||
| //                    } else {
 |  | ||||||
|                     //    Process the argument with the appropriate function call
 |                     //    Process the argument with the appropriate function call
 | ||||||
|                     if ($passCellReference) { |                     if ($passCellReference) { | ||||||
|                         $args[] = $pCell; |                         $args[] = $pCell; | ||||||
| @ -3819,17 +3736,13 @@ class Calculation | |||||||
|                 // if the token is a number, boolean, string or an Excel error, push it onto the stack
 |                 // if the token is a number, boolean, string or an Excel error, push it onto the stack
 | ||||||
|                 if (isset(self::$excelConstants[strtoupper($token)])) { |                 if (isset(self::$excelConstants[strtoupper($token)])) { | ||||||
|                     $excelConstant = strtoupper($token); |                     $excelConstant = strtoupper($token); | ||||||
| //                    echo 'Token is a PhpSpreadsheet constant: '.$excelConstant.'<br />';
 |  | ||||||
|                     $stack->push('Constant Value', self::$excelConstants[$excelConstant]); |                     $stack->push('Constant Value', self::$excelConstants[$excelConstant]); | ||||||
|                     $this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->showTypeDetails(self::$excelConstants[$excelConstant])); |                     $this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->showTypeDetails(self::$excelConstants[$excelConstant])); | ||||||
|                 } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) { |                 } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) { | ||||||
|                     //                    echo 'Token is a number, boolean, string, null or an Excel error<br />';
 |  | ||||||
|                     $stack->push('Value', $token); |                     $stack->push('Value', $token); | ||||||
|                 // if the token is a named range, push the named range name onto the stack
 |                 // if the token is a named range, push the named range name onto the stack
 | ||||||
|                 } elseif (preg_match('/^' . self::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $token, $matches)) { |                 } elseif (preg_match('/^' . self::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $token, $matches)) { | ||||||
|                     //                    echo 'Token is a named range<br />';
 |  | ||||||
|                     $namedRange = $matches[6]; |                     $namedRange = $matches[6]; | ||||||
| //                    echo 'Named Range is '.$namedRange.'<br />';
 |  | ||||||
|                     $this->_debugLog->writeDebugLog('Evaluating Named Range ', $namedRange); |                     $this->_debugLog->writeDebugLog('Evaluating Named Range ', $namedRange); | ||||||
|                     $cellValue = $this->extractNamedRange($namedRange, ((null !== $pCell) ? $pCellWorksheet : null), false); |                     $cellValue = $this->extractNamedRange($namedRange, ((null !== $pCell) ? $pCellWorksheet : null), false); | ||||||
|                     $pCell->attach($pCellParent); |                     $pCell->attach($pCellParent); | ||||||
| @ -4130,16 +4043,10 @@ class Calculation | |||||||
|         // Return value
 |         // Return value
 | ||||||
|         $returnValue = []; |         $returnValue = []; | ||||||
| 
 | 
 | ||||||
| //        echo 'extractCellRange('.$pRange.')', PHP_EOL;
 |  | ||||||
|         if ($pSheet !== null) { |         if ($pSheet !== null) { | ||||||
|             $pSheetName = $pSheet->getTitle(); |             $pSheetName = $pSheet->getTitle(); | ||||||
| //            echo 'Passed sheet name is '.$pSheetName.PHP_EOL;
 |  | ||||||
| //            echo 'Range reference is '.$pRange.PHP_EOL;
 |  | ||||||
|             if (strpos($pRange, '!') !== false) { |             if (strpos($pRange, '!') !== false) { | ||||||
|                 //                echo '$pRange reference includes sheet reference', PHP_EOL;
 |  | ||||||
|                 list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true); |                 list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true); | ||||||
| //                echo 'New sheet name is '.$pSheetName, PHP_EOL;
 |  | ||||||
| //                echo 'Adjusted Range reference is '.$pRange, PHP_EOL;
 |  | ||||||
|                 $pSheet = $this->spreadsheet->getSheetByName($pSheetName); |                 $pSheet = $this->spreadsheet->getSheetByName($pSheetName); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
| @ -4187,16 +4094,10 @@ class Calculation | |||||||
|         // Return value
 |         // Return value
 | ||||||
|         $returnValue = []; |         $returnValue = []; | ||||||
| 
 | 
 | ||||||
| //        echo 'extractNamedRange('.$pRange.')<br />';
 |  | ||||||
|         if ($pSheet !== null) { |         if ($pSheet !== null) { | ||||||
|             $pSheetName = $pSheet->getTitle(); |             $pSheetName = $pSheet->getTitle(); | ||||||
| //            echo 'Current sheet name is '.$pSheetName.'<br />';
 |  | ||||||
| //            echo 'Range reference is '.$pRange.'<br />';
 |  | ||||||
|             if (strpos($pRange, '!') !== false) { |             if (strpos($pRange, '!') !== false) { | ||||||
|                 //                echo '$pRange reference includes sheet reference', PHP_EOL;
 |  | ||||||
|                 list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true); |                 list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true); | ||||||
| //                echo 'New sheet name is '.$pSheetName, PHP_EOL;
 |  | ||||||
| //                echo 'Adjusted Range reference is '.$pRange, PHP_EOL;
 |  | ||||||
|                 $pSheet = $this->spreadsheet->getSheetByName($pSheetName); |                 $pSheet = $this->spreadsheet->getSheetByName($pSheetName); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
| @ -4204,7 +4105,6 @@ class Calculation | |||||||
|             $namedRange = NamedRange::resolveRange($pRange, $pSheet); |             $namedRange = NamedRange::resolveRange($pRange, $pSheet); | ||||||
|             if ($namedRange !== null) { |             if ($namedRange !== null) { | ||||||
|                 $pSheet = $namedRange->getWorksheet(); |                 $pSheet = $namedRange->getWorksheet(); | ||||||
| //                echo 'Named Range '.$pRange.' (';
 |  | ||||||
|                 $pRange = $namedRange->getRange(); |                 $pRange = $namedRange->getRange(); | ||||||
|                 $splitRange = Cell::splitRange($pRange); |                 $splitRange = Cell::splitRange($pRange); | ||||||
|                 //    Convert row and column references
 |                 //    Convert row and column references
 | ||||||
| @ -4213,22 +4113,12 @@ class Calculation | |||||||
|                 } elseif (ctype_digit($splitRange[0][0])) { |                 } elseif (ctype_digit($splitRange[0][0])) { | ||||||
|                     $pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1]; |                     $pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1]; | ||||||
|                 } |                 } | ||||||
| //                echo $pRange.') is in sheet '.$namedRange->getWorksheet()->getTitle().'<br />';
 |  | ||||||
| 
 |  | ||||||
| //                if ($pSheet->getTitle() != $namedRange->getWorksheet()->getTitle()) {
 |  | ||||||
| //                    if (!$namedRange->getLocalOnly()) {
 |  | ||||||
| //                        $pSheet = $namedRange->getWorksheet();
 |  | ||||||
| //                    } else {
 |  | ||||||
| //                        return $returnValue;
 |  | ||||||
| //                    }
 |  | ||||||
| //                }
 |  | ||||||
|             } else { |             } else { | ||||||
|                 return Calculation\Functions::REF(); |                 return Calculation\Functions::REF(); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             // Extract range
 |             // Extract range
 | ||||||
|             $aReferences = Cell::extractAllCellReferencesInRange($pRange); |             $aReferences = Cell::extractAllCellReferencesInRange($pRange); | ||||||
| //            var_dump($aReferences);
 |  | ||||||
|             if (!isset($aReferences[1])) { |             if (!isset($aReferences[1])) { | ||||||
|                 //    Single cell (or single column or row) in range
 |                 //    Single cell (or single column or row) in range
 | ||||||
|                 list($currentCol, $currentRow) = Cell::coordinateFromString($aReferences[0]); |                 list($currentCol, $currentRow) = Cell::coordinateFromString($aReferences[0]); | ||||||
| @ -4243,7 +4133,6 @@ class Calculation | |||||||
|                 foreach ($aReferences as $reference) { |                 foreach ($aReferences as $reference) { | ||||||
|                     // Extract range
 |                     // Extract range
 | ||||||
|                     list($currentCol, $currentRow) = Cell::coordinateFromString($reference); |                     list($currentCol, $currentRow) = Cell::coordinateFromString($reference); | ||||||
| //                    echo 'NAMED RANGE: $currentCol='.$currentCol.' $currentRow='.$currentRow.'<br />';
 |  | ||||||
|                     $cellValue = null; |                     $cellValue = null; | ||||||
|                     if ($pSheet->cellExists($reference)) { |                     if ($pSheet->cellExists($reference)) { | ||||||
|                         $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog); |                         $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog); | ||||||
| @ -4252,8 +4141,6 @@ class Calculation | |||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| //                print_r($returnValue);
 |  | ||||||
| //            echo '<br />';
 |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return $returnValue; |         return $returnValue; | ||||||
|  | |||||||
| @ -661,8 +661,6 @@ class MathTrig | |||||||
| 
 | 
 | ||||||
|             return $matrixA->times($matrixB)->getArray(); |             return $matrixA->times($matrixB)->getArray(); | ||||||
|         } catch (\PhpSpreadsheet\Exception $ex) { |         } catch (\PhpSpreadsheet\Exception $ex) { | ||||||
|             var_dump($ex->getMessage()); |  | ||||||
| 
 |  | ||||||
|             return Functions::VALUE(); |             return Functions::VALUE(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -1409,7 +1409,6 @@ class Statistical | |||||||
|             $PGuess = $UnscaledPGuess / $TotalUnscaledProbability; |             $PGuess = $UnscaledPGuess / $TotalUnscaledProbability; | ||||||
|             $CumPGuess = $UnscaledCumPGuess / $TotalUnscaledProbability; |             $CumPGuess = $UnscaledCumPGuess / $TotalUnscaledProbability; | ||||||
| 
 | 
 | ||||||
| //            $CumPGuessMinus1 = $CumPGuess - $PGuess;
 |  | ||||||
|             $CumPGuessMinus1 = $CumPGuess - 1; |             $CumPGuessMinus1 = $CumPGuess - 1; | ||||||
| 
 | 
 | ||||||
|             while (true) { |             while (true) { | ||||||
|  | |||||||
| @ -262,14 +262,11 @@ class Cell | |||||||
|      */ |      */ | ||||||
|     public function getCalculatedValue($resetLog = true) |     public function getCalculatedValue($resetLog = true) | ||||||
|     { |     { | ||||||
|         //echo 'Cell '.$this->getCoordinate().' value is a '.$this->dataType.' with a value of '.$this->getValue().PHP_EOL;
 |  | ||||||
|         if ($this->dataType == Cell\DataType::TYPE_FORMULA) { |         if ($this->dataType == Cell\DataType::TYPE_FORMULA) { | ||||||
|             try { |             try { | ||||||
|                 //echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL;
 |  | ||||||
|                 $result = Calculation::getInstance( |                 $result = Calculation::getInstance( | ||||||
|                     $this->getWorksheet()->getParent() |                     $this->getWorksheet()->getParent() | ||||||
|                 )->calculateCellValue($this, $resetLog); |                 )->calculateCellValue($this, $resetLog); | ||||||
| //echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL;
 |  | ||||||
|                 //    We don't yet handle array returns
 |                 //    We don't yet handle array returns
 | ||||||
|                 if (is_array($result)) { |                 if (is_array($result)) { | ||||||
|                     while (is_array($result)) { |                     while (is_array($result)) { | ||||||
| @ -278,10 +275,8 @@ class Cell | |||||||
|                 } |                 } | ||||||
|             } catch (Exception $ex) { |             } catch (Exception $ex) { | ||||||
|                 if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) { |                 if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) { | ||||||
|                     //echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
 |  | ||||||
|                     return $this->calculatedValue; // Fallback for calculations referencing external files.
 |                     return $this->calculatedValue; // Fallback for calculations referencing external files.
 | ||||||
|                 } |                 } | ||||||
| //echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL;
 |  | ||||||
|                 $result = '#N/A'; |                 $result = '#N/A'; | ||||||
|                 throw new Calculation\Exception( |                 throw new Calculation\Exception( | ||||||
|                     $this->getWorksheet()->getTitle() . '!' . $this->getCoordinate() . ' -> ' . $ex->getMessage() |                     $this->getWorksheet()->getTitle() . '!' . $this->getCoordinate() . ' -> ' . $ex->getMessage() | ||||||
| @ -289,16 +284,14 @@ class Cell | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if ($result === '#Not Yet Implemented') { |             if ($result === '#Not Yet Implemented') { | ||||||
|                 //echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
 |  | ||||||
|                 return $this->calculatedValue; // Fallback if calculation engine does not support the formula.
 |                 return $this->calculatedValue; // Fallback if calculation engine does not support the formula.
 | ||||||
|             } |             } | ||||||
| //echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL;
 | 
 | ||||||
|             return $result; |             return $result; | ||||||
|         } elseif ($this->value instanceof RichText) { |         } elseif ($this->value instanceof RichText) { | ||||||
|             //        echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->value.'<br />';
 |  | ||||||
|             return $this->value->getPlainText(); |             return $this->value->getPlainText(); | ||||||
|         } |         } | ||||||
| //        echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->value.'<br />';
 | 
 | ||||||
|         return $this->value; |         return $this->value; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Chart; | namespace PhpSpreadsheet\Chart; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Chart\DataSeriesValues |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Chart; | namespace PhpSpreadsheet\Chart; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Chart\Layout |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Chart; | namespace PhpSpreadsheet\Chart; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Chart\Legend |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -96,7 +96,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|         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 />';
 |  | ||||||
| 
 | 
 | ||||||
|         return $valid; |         return $valid; | ||||||
|     } |     } | ||||||
| @ -404,15 +403,12 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|         foreach ($xml->Styles[0] as $style) { |         foreach ($xml->Styles[0] as $style) { | ||||||
|             $style_ss = $style->attributes($namespaces['ss']); |             $style_ss = $style->attributes($namespaces['ss']); | ||||||
|             $styleID = (string) $style_ss['ID']; |             $styleID = (string) $style_ss['ID']; | ||||||
| //            echo 'Style ID = '.$styleID.'<br />';
 |  | ||||||
|             $this->styles[$styleID] = (isset($this->styles['Default'])) ? $this->styles['Default'] : []; |             $this->styles[$styleID] = (isset($this->styles['Default'])) ? $this->styles['Default'] : []; | ||||||
|             foreach ($style as $styleType => $styleData) { |             foreach ($style as $styleType => $styleData) { | ||||||
|                 $styleAttributes = $styleData->attributes($namespaces['ss']); |                 $styleAttributes = $styleData->attributes($namespaces['ss']); | ||||||
| //                echo $styleType.'<br />';
 |  | ||||||
|                 switch ($styleType) { |                 switch ($styleType) { | ||||||
|                     case 'Alignment': |                     case 'Alignment': | ||||||
|                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { |                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { | ||||||
|                             //                                echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
 |  | ||||||
|                             $styleAttributeValue = (string) $styleAttributeValue; |                             $styleAttributeValue = (string) $styleAttributeValue; | ||||||
|                             switch ($styleAttributeKey) { |                             switch ($styleAttributeKey) { | ||||||
|                                 case 'Vertical': |                                 case 'Vertical': | ||||||
| @ -436,14 +432,11 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                             $borderAttributes = $borderStyle->attributes($namespaces['ss']); |                             $borderAttributes = $borderStyle->attributes($namespaces['ss']); | ||||||
|                             $thisBorder = []; |                             $thisBorder = []; | ||||||
|                             foreach ($borderAttributes as $borderStyleKey => $borderStyleValue) { |                             foreach ($borderAttributes as $borderStyleKey => $borderStyleValue) { | ||||||
|                                 //                                    echo $borderStyleKey.' = '.$borderStyleValue.'<br />';
 |  | ||||||
|                                 switch ($borderStyleKey) { |                                 switch ($borderStyleKey) { | ||||||
|                                     case 'LineStyle': |                                     case 'LineStyle': | ||||||
|                                         $thisBorder['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM; |                                         $thisBorder['style'] = \PhpSpreadsheet\Style\Border::BORDER_MEDIUM; | ||||||
| //                                                $thisBorder['style'] = $borderStyleValue;
 |  | ||||||
|                                         break; |                                         break; | ||||||
|                                     case 'Weight': |                                     case 'Weight': | ||||||
| //                                                $thisBorder['style'] = $borderStyleValue;
 |  | ||||||
|                                         break; |                                         break; | ||||||
|                                     case 'Position': |                                     case 'Position': | ||||||
|                                         $borderPosition = strtolower($borderStyleValue); |                                         $borderPosition = strtolower($borderStyleValue); | ||||||
| @ -463,7 +456,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                         break; |                         break; | ||||||
|                     case 'Font': |                     case 'Font': | ||||||
|                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { |                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { | ||||||
|                             //                                echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
 |  | ||||||
|                             $styleAttributeValue = (string) $styleAttributeValue; |                             $styleAttributeValue = (string) $styleAttributeValue; | ||||||
|                             switch ($styleAttributeKey) { |                             switch ($styleAttributeKey) { | ||||||
|                                 case 'FontName': |                                 case 'FontName': | ||||||
| @ -491,7 +483,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                         break; |                         break; | ||||||
|                     case 'Interior': |                     case 'Interior': | ||||||
|                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { |                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { | ||||||
|                             //                                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); | ||||||
| @ -501,7 +492,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                         break; |                         break; | ||||||
|                     case 'NumberFormat': |                     case 'NumberFormat': | ||||||
|                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { |                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { | ||||||
|                             //                                echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
 |  | ||||||
|                             $styleAttributeValue = str_replace($fromFormats, $toFormats, $styleAttributeValue); |                             $styleAttributeValue = str_replace($fromFormats, $toFormats, $styleAttributeValue); | ||||||
|                             switch ($styleAttributeValue) { |                             switch ($styleAttributeValue) { | ||||||
|                                 case 'Short Date': |                                 case 'Short Date': | ||||||
| @ -515,15 +505,11 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                         break; |                         break; | ||||||
|                     case 'Protection': |                     case 'Protection': | ||||||
|                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { |                         foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) { | ||||||
|                             //                                echo $styleAttributeKey.' = '.$styleAttributeValue.'<br />';
 |  | ||||||
|                         } |                         } | ||||||
|                         break; |                         break; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| //            print_r($this->styles[$styleID]);
 |  | ||||||
| //            echo '<hr />';
 |  | ||||||
|         } |         } | ||||||
| //        echo '<hr />';
 |  | ||||||
| 
 | 
 | ||||||
|         $worksheetID = 0; |         $worksheetID = 0; | ||||||
|         $xml_ss = $xml->children($namespaces['ss']); |         $xml_ss = $xml->children($namespaces['ss']); | ||||||
| @ -536,8 +522,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
| //            echo '<h3>Worksheet: ', $worksheet_ss['Name'],'<h3>';
 |  | ||||||
| //
 |  | ||||||
|             // Create new Worksheet
 |             // Create new Worksheet
 | ||||||
|             $spreadsheet->createSheet(); |             $spreadsheet->createSheet(); | ||||||
|             $spreadsheet->setActiveSheetIndex($worksheetID); |             $spreadsheet->setActiveSheetIndex($worksheetID); | ||||||
| @ -558,7 +542,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                     } |                     } | ||||||
|                     if (isset($columnData_ss['Width'])) { |                     if (isset($columnData_ss['Width'])) { | ||||||
|                         $columnWidth = $columnData_ss['Width']; |                         $columnWidth = $columnData_ss['Width']; | ||||||
| //                        echo '<b>Setting column width for '.$columnID.' to '.$columnWidth.'</b><br />';
 |  | ||||||
|                         $spreadsheet->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4); |                         $spreadsheet->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4); | ||||||
|                     } |                     } | ||||||
|                     ++$columnID; |                     ++$columnID; | ||||||
| @ -574,7 +557,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                     if (isset($row_ss['Index'])) { |                     if (isset($row_ss['Index'])) { | ||||||
|                         $rowID = (integer) $row_ss['Index']; |                         $rowID = (integer) $row_ss['Index']; | ||||||
|                     } |                     } | ||||||
| //                    echo '<b>Row '.$rowID.'</b><br />';
 |  | ||||||
| 
 | 
 | ||||||
|                     $columnID = 'A'; |                     $columnID = 'A'; | ||||||
|                     foreach ($rowData->Cell as $cell) { |                     foreach ($rowData->Cell as $cell) { | ||||||
| @ -611,7 +593,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                             // added this as a check for array formulas
 |                             // added this as a check for array formulas
 | ||||||
|                             if (isset($cell_ss['ArrayRange'])) { |                             if (isset($cell_ss['ArrayRange'])) { | ||||||
|                                 $cellDataCSEFormula = $cell_ss['ArrayRange']; |                                 $cellDataCSEFormula = $cell_ss['ArrayRange']; | ||||||
| //                                echo "found an array formula at ".$columnID.$rowID."<br />";
 |  | ||||||
|                             } |                             } | ||||||
|                             $hasCalculatedValue = true; |                             $hasCalculatedValue = true; | ||||||
|                         } |                         } | ||||||
| @ -657,12 +638,10 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                             } |                             } | ||||||
| 
 | 
 | ||||||
|                             if ($hasCalculatedValue) { |                             if ($hasCalculatedValue) { | ||||||
|                                 //                                echo 'FORMULA<br />';
 |  | ||||||
|                                 $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; |                                 $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; | ||||||
|                                 $columnNumber = \PhpSpreadsheet\Cell::columnIndexFromString($columnID); |                                 $columnNumber = \PhpSpreadsheet\Cell::columnIndexFromString($columnID); | ||||||
|                                 if (substr($cellDataFormula, 0, 3) == 'of:') { |                                 if (substr($cellDataFormula, 0, 3) == 'of:') { | ||||||
|                                     $cellDataFormula = substr($cellDataFormula, 3); |                                     $cellDataFormula = substr($cellDataFormula, 3); | ||||||
| //                                    echo 'Before: ', $cellDataFormula,'<br />';
 |  | ||||||
|                                     $temp = explode('"', $cellDataFormula); |                                     $temp = explode('"', $cellDataFormula); | ||||||
|                                     $key = false; |                                     $key = false; | ||||||
|                                     foreach ($temp as &$value) { |                                     foreach ($temp as &$value) { | ||||||
| @ -673,7 +652,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                                     } |                                     } | ||||||
|                                 } else { |                                 } else { | ||||||
|                                     //    Convert R1C1 style references to A1 style references (but only when not quoted)
 |                                     //    Convert R1C1 style references to A1 style references (but only when not quoted)
 | ||||||
| //                                    echo 'Before: ', $cellDataFormula,'<br />';
 |  | ||||||
|                                     $temp = explode('"', $cellDataFormula); |                                     $temp = explode('"', $cellDataFormula); | ||||||
|                                     $key = false; |                                     $key = false; | ||||||
|                                     foreach ($temp as &$value) { |                                     foreach ($temp as &$value) { | ||||||
| @ -714,42 +692,29 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                                 unset($value); |                                 unset($value); | ||||||
|                                 //    Then rebuild the formula string
 |                                 //    Then rebuild the formula string
 | ||||||
|                                 $cellDataFormula = implode('"', $temp); |                                 $cellDataFormula = implode('"', $temp); | ||||||
| //                                echo 'After: ', $cellDataFormula,'<br />';
 |  | ||||||
|                             } |                             } | ||||||
| 
 | 
 | ||||||
| //                            echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'<br />';
 |  | ||||||
| //
 |  | ||||||
|                             $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); |                             $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); | ||||||
|                             if ($hasCalculatedValue) { |                             if ($hasCalculatedValue) { | ||||||
|                                 //                                echo 'Formula result is '.$cellValue.'<br />';
 |  | ||||||
|                                 $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setCalculatedValue($cellValue); |                                 $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setCalculatedValue($cellValue); | ||||||
|                             } |                             } | ||||||
|                             $cellIsSet = $rowHasData = true; |                             $cellIsSet = $rowHasData = true; | ||||||
|                         } |                         } | ||||||
| 
 | 
 | ||||||
|                         if (isset($cell->Comment)) { |                         if (isset($cell->Comment)) { | ||||||
|                             //                            echo '<b>comment found</b><br />';
 |  | ||||||
|                             $commentAttributes = $cell->Comment->attributes($namespaces['ss']); |                             $commentAttributes = $cell->Comment->attributes($namespaces['ss']); | ||||||
|                             $author = 'unknown'; |                             $author = 'unknown'; | ||||||
|                             if (isset($commentAttributes->Author)) { |                             if (isset($commentAttributes->Author)) { | ||||||
|                                 $author = (string) $commentAttributes->Author; |                                 $author = (string) $commentAttributes->Author; | ||||||
| //                                echo 'Author: ', $author,'<br />';
 |  | ||||||
|                             } |                             } | ||||||
|                             $node = $cell->Comment->Data->asXML(); |                             $node = $cell->Comment->Data->asXML(); | ||||||
| //                            $annotation = str_replace('html:','',substr($node,49,-10));
 |  | ||||||
| //                            echo $annotation,'<br />';
 |  | ||||||
|                             $annotation = strip_tags($node); |                             $annotation = strip_tags($node); | ||||||
| //                            echo 'Annotation: ', $annotation,'<br />';
 |  | ||||||
|                             $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); |                             $spreadsheet->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 />';
 |  | ||||||
|                             if ((isset($this->styles[$style])) && (!empty($this->styles[$style]))) { |                             if ((isset($this->styles[$style])) && (!empty($this->styles[$style]))) { | ||||||
|                                 //                                echo 'Cell '.$columnID.$rowID.'<br />';
 |  | ||||||
| //                                print_r($this->styles[$style]);
 |  | ||||||
| //                                echo '<br />';
 |  | ||||||
|                                 if (!$spreadsheet->getActiveSheet()->cellExists($columnID . $rowID)) { |                                 if (!$spreadsheet->getActiveSheet()->cellExists($columnID . $rowID)) { | ||||||
|                                     $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValue(null); |                                     $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValue(null); | ||||||
|                                 } |                                 } | ||||||
| @ -769,7 +734,6 @@ class Excel2003XML extends BaseReader implements IReader | |||||||
|                         } |                         } | ||||||
|                         if (isset($row_ss['Height'])) { |                         if (isset($row_ss['Height'])) { | ||||||
|                             $rowHeight = $row_ss['Height']; |                             $rowHeight = $row_ss['Height']; | ||||||
| //                            echo '<b>Setting row height to '.$rowHeight.'</b><br />';
 |  | ||||||
|                             $spreadsheet->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight); |                             $spreadsheet->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight); | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -259,7 +259,6 @@ class Excel2007 extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|     private static function castToBoolean($c) |     private static function castToBoolean($c) | ||||||
|     { |     { | ||||||
|         //        echo 'Initial Cast to Boolean', PHP_EOL;
 |  | ||||||
|         $value = isset($c->v) ? (string) $c->v : null; |         $value = isset($c->v) ? (string) $c->v : null; | ||||||
|         if ($value == '0') { |         if ($value == '0') { | ||||||
|             return false; |             return false; | ||||||
| @ -274,44 +273,27 @@ class Excel2007 extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|     private static function castToError($c) |     private static function castToError($c) | ||||||
|     { |     { | ||||||
|         //        echo 'Initial Cast to Error', PHP_EOL;
 |  | ||||||
|         return isset($c->v) ? (string) $c->v : null; |         return isset($c->v) ? (string) $c->v : null; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private static function castToString($c) |     private static function castToString($c) | ||||||
|     { |     { | ||||||
|         //        echo 'Initial Cast to String, PHP_EOL;
 |  | ||||||
|         return isset($c->v) ? (string) $c->v : null; |         return isset($c->v) ? (string) $c->v : null; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType) |     private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType) | ||||||
|     { |     { | ||||||
|         //        echo 'Formula', PHP_EOL;
 |  | ||||||
| //        echo '$c->f is ', $c->f, PHP_EOL;
 |  | ||||||
|         $cellDataType = 'f'; |         $cellDataType = 'f'; | ||||||
|         $value = "={$c->f}"; |         $value = "={$c->f}"; | ||||||
|         $calculatedValue = self::$castBaseType($c); |         $calculatedValue = self::$castBaseType($c); | ||||||
| 
 | 
 | ||||||
|         // Shared formula?
 |         // Shared formula?
 | ||||||
|         if (isset($c->f['t']) && strtolower((string) $c->f['t']) == 'shared') { |         if (isset($c->f['t']) && strtolower((string) $c->f['t']) == 'shared') { | ||||||
|             //            echo 'SHARED FORMULA', PHP_EOL;
 |  | ||||||
|             $instance = (string) $c->f['si']; |             $instance = (string) $c->f['si']; | ||||||
| 
 | 
 | ||||||
| //            echo 'Instance ID = ', $instance, PHP_EOL;
 |  | ||||||
| //
 |  | ||||||
| //            echo 'Shared Formula Array:', PHP_EOL;
 |  | ||||||
| //            print_r($sharedFormulas);
 |  | ||||||
|             if (!isset($sharedFormulas[(string) $c->f['si']])) { |             if (!isset($sharedFormulas[(string) $c->f['si']])) { | ||||||
|                 //                echo 'SETTING NEW SHARED FORMULA', PHP_EOL;
 |  | ||||||
| //                echo 'Master is ', $r, PHP_EOL;
 |  | ||||||
| //                echo 'Formula is ', $value, PHP_EOL;
 |  | ||||||
|                 $sharedFormulas[$instance] = ['master' => $r, 'formula' => $value]; |                 $sharedFormulas[$instance] = ['master' => $r, 'formula' => $value]; | ||||||
| //                echo 'New Shared Formula Array:', PHP_EOL;
 |  | ||||||
| //                print_r($sharedFormulas);
 |  | ||||||
|             } else { |             } else { | ||||||
|                 //                echo 'GETTING SHARED FORMULA', PHP_EOL;
 |  | ||||||
| //                echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL;
 |  | ||||||
| //                echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL;
 |  | ||||||
|                 $master = \PhpSpreadsheet\Cell::coordinateFromString($sharedFormulas[$instance]['master']); |                 $master = \PhpSpreadsheet\Cell::coordinateFromString($sharedFormulas[$instance]['master']); | ||||||
|                 $current = \PhpSpreadsheet\Cell::coordinateFromString($r); |                 $current = \PhpSpreadsheet\Cell::coordinateFromString($r); | ||||||
| 
 | 
 | ||||||
| @ -320,7 +302,6 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|                 $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;
 |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -828,11 +809,7 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|                                         if ($col['style'] && !$this->readDataOnly) { |                                         if ($col['style'] && !$this->readDataOnly) { | ||||||
|                                             $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col['style'])); |                                             $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setXfIndex(intval($col['style'])); | ||||||
|                                         } |                                         } | ||||||
|                                         if (self::boolean($col['bestFit'])) { |  | ||||||
|                                             //$docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setAutoSize(true);
 |  | ||||||
|                                         } |  | ||||||
|                                         if (self::boolean($col['hidden'])) { |                                         if (self::boolean($col['hidden'])) { | ||||||
|                                             // echo \PhpSpreadsheet\Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL;
 |  | ||||||
|                                             $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setVisible(false); |                                             $docSheet->getColumnDimension(\PhpSpreadsheet\Cell::stringFromColumnIndex($i))->setVisible(false); | ||||||
|                                         } |                                         } | ||||||
|                                         if (self::boolean($col['collapsed'])) { |                                         if (self::boolean($col['collapsed'])) { | ||||||
| @ -898,15 +875,9 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|                                             } |                                             } | ||||||
|                                         } |                                         } | ||||||
| 
 | 
 | ||||||
|     //                                    echo 'Reading cell ', $coordinates[0], $coordinates[1], PHP_EOL;
 |  | ||||||
|     //                                    print_r($c);
 |  | ||||||
|     //                                    echo PHP_EOL;
 |  | ||||||
|     //                                    echo 'Cell Data Type is ', $cellDataType, ': ';
 |  | ||||||
|     //
 |  | ||||||
|                                         // Read cell!
 |                                         // Read cell!
 | ||||||
|                                         switch ($cellDataType) { |                                         switch ($cellDataType) { | ||||||
|                                             case 's': |                                             case 's': | ||||||
|     //                                            echo 'String', PHP_EOL;
 |  | ||||||
|                                                 if ((string) $c->v != '') { |                                                 if ((string) $c->v != '') { | ||||||
|                                                     $value = $sharedStrings[intval($c->v)]; |                                                     $value = $sharedStrings[intval($c->v)]; | ||||||
| 
 | 
 | ||||||
| @ -918,7 +889,6 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|                                                 } |                                                 } | ||||||
|                                                 break; |                                                 break; | ||||||
|                                             case 'b': |                                             case 'b': | ||||||
|     //                                            echo 'Boolean', PHP_EOL;
 |  | ||||||
|                                                 if (!isset($c->f)) { |                                                 if (!isset($c->f)) { | ||||||
|                                                     $value = self::castToBoolean($c); |                                                     $value = self::castToBoolean($c); | ||||||
|                                                 } else { |                                                 } else { | ||||||
| @ -929,11 +899,9 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|                                                         $att = $c->f; |                                                         $att = $c->f; | ||||||
|                                                         $docSheet->getCell($r)->setFormulaAttributes($att); |                                                         $docSheet->getCell($r)->setFormulaAttributes($att); | ||||||
|                                                     } |                                                     } | ||||||
|     //                                                echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
 |  | ||||||
|                                                 } |                                                 } | ||||||
|                                                 break; |                                                 break; | ||||||
|                                             case 'inlineStr': |                                             case 'inlineStr': | ||||||
| //                                                echo 'Inline String', PHP_EOL;
 |  | ||||||
|                                                 if (isset($c->f)) { |                                                 if (isset($c->f)) { | ||||||
|                                                     $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError'); |                                                     $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError'); | ||||||
|                                                 } else { |                                                 } else { | ||||||
| @ -941,29 +909,22 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|                                                 } |                                                 } | ||||||
|                                                 break; |                                                 break; | ||||||
|                                             case 'e': |                                             case 'e': | ||||||
|     //                                            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;
 |  | ||||||
|                                                 } |                                                 } | ||||||
|                                                 break; |                                                 break; | ||||||
|                                             default: |                                             default: | ||||||
| //                                                echo 'Default', PHP_EOL;
 |  | ||||||
|                                                 if (!isset($c->f)) { |                                                 if (!isset($c->f)) { | ||||||
|                                                     //                                                echo 'Not a Formula', PHP_EOL;
 |  | ||||||
|                                                     $value = self::castToString($c); |                                                     $value = self::castToString($c); | ||||||
|                                                 } else { |                                                 } else { | ||||||
|                                                     //                                                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;
 |  | ||||||
|                                                 } |                                                 } | ||||||
|                                                 break; |                                                 break; | ||||||
|                                         } |                                         } | ||||||
|     //                                    echo 'Value is ', $value, PHP_EOL;
 |  | ||||||
| 
 | 
 | ||||||
|                                         // Check for numeric values
 |                                         // Check for numeric values
 | ||||||
|                                         if (is_numeric($value) && $cellDataType != 's') { |                                         if (is_numeric($value) && $cellDataType != 's') { | ||||||
| @ -1870,15 +1831,10 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|                             ); |                             ); | ||||||
|                             $objChart = \PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); |                             $objChart = \PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); | ||||||
| 
 | 
 | ||||||
| //                            echo 'Chart ', $chartEntryRef, '<br />';
 |  | ||||||
| //                            var_dump($charts[$chartEntryRef]);
 |  | ||||||
| //
 | //
 | ||||||
|                             if (isset($charts[$chartEntryRef])) { |                             if (isset($charts[$chartEntryRef])) { | ||||||
|                                 $chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id']; |                                 $chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id']; | ||||||
| //                                echo 'Position Ref ', $chartPositionRef, '<br />';
 |  | ||||||
|                                 if (isset($chartDetails[$chartPositionRef])) { |                                 if (isset($chartDetails[$chartPositionRef])) { | ||||||
|                                     //                                    var_dump($chartDetails[$chartPositionRef]);
 |  | ||||||
| 
 |  | ||||||
|                                     $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart); |                                     $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart); | ||||||
|                                     $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet'])); |                                     $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet'])); | ||||||
|                                     $objChart->setTopLeftPosition($chartDetails[$chartPositionRef]['fromCoordinate'], $chartDetails[$chartPositionRef]['fromOffsetX'], $chartDetails[$chartPositionRef]['fromOffsetY']); |                                     $objChart->setTopLeftPosition($chartDetails[$chartPositionRef]['fromCoordinate'], $chartDetails[$chartPositionRef]['fromOffsetX'], $chartDetails[$chartPositionRef]['fromOffsetY']); | ||||||
| @ -1925,14 +1881,7 @@ class Excel2007 extends BaseReader implements IReader | |||||||
|      */ |      */ | ||||||
|     private static function readStyle($docStyle, \PhpSpreadsheet\Style $style) |     private static function readStyle($docStyle, \PhpSpreadsheet\Style $style) | ||||||
|     { |     { | ||||||
|         // format code
 |         $docStyle->getNumberFormat()->setFormatCode($style->numFmt); | ||||||
| //        if (isset($style->numFmt)) {
 |  | ||||||
| //            if (isset($style->numFmt['formatCode'])) {
 |  | ||||||
| //                $docStyle->getNumberFormat()->setFormatCode((string) $style->numFmt['formatCode']);
 |  | ||||||
| //            } else {
 |  | ||||||
|                 $docStyle->getNumberFormat()->setFormatCode($style->numFmt); |  | ||||||
| //            }
 |  | ||||||
| //        }
 |  | ||||||
| 
 | 
 | ||||||
|         // font
 |         // font
 | ||||||
|         if (isset($style->font)) { |         if (isset($style->font)) { | ||||||
|  | |||||||
| @ -240,7 +240,6 @@ class Chart | |||||||
|         } |         } | ||||||
|         $layout = []; |         $layout = []; | ||||||
|         foreach ($details as $detailKey => $detail) { |         foreach ($details as $detailKey => $detail) { | ||||||
|             //            echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL;
 |  | ||||||
|             $layout[$detailKey] = self::getAttribute($detail, 'val', 'string'); |             $layout[$detailKey] = self::getAttribute($detail, 'val', 'string'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -991,10 +991,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|             // treat OBJ records
 |             // treat OBJ records
 | ||||||
|             foreach ($this->objs as $n => $obj) { |             foreach ($this->objs as $n => $obj) { | ||||||
|                 //                echo '<hr /><b>Object</b> reference is ', $n,'<br />';
 |  | ||||||
| //                var_dump($obj);
 |  | ||||||
| //                echo '<br />';
 |  | ||||||
| 
 |  | ||||||
|                 // the first shape container never has a corresponding OBJ record, hence $n + 1
 |                 // the first shape container never has a corresponding OBJ record, hence $n + 1
 | ||||||
|                 if (isset($allSpContainers[$n + 1]) && is_object($allSpContainers[$n + 1])) { |                 if (isset($allSpContainers[$n + 1]) && is_object($allSpContainers[$n + 1])) { | ||||||
|                     $spContainer = $allSpContainers[$n + 1]; |                     $spContainer = $allSpContainers[$n + 1]; | ||||||
| @ -1023,8 +1019,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|                     switch ($obj['otObjType']) { |                     switch ($obj['otObjType']) { | ||||||
|                         case 0x19: |                         case 0x19: | ||||||
|                             // Note
 |                             // Note
 | ||||||
| //                            echo 'Cell Annotation Object<br />';
 |  | ||||||
| //                            echo 'Object ID is ', $obj['idObjID'],'<br />';
 |  | ||||||
|                             if (isset($this->cellNotes[$obj['idObjID']])) { |                             if (isset($this->cellNotes[$obj['idObjID']])) { | ||||||
|                                 $cellNote = $this->cellNotes[$obj['idObjID']]; |                                 $cellNote = $this->cellNotes[$obj['idObjID']]; | ||||||
| 
 | 
 | ||||||
| @ -1035,7 +1029,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|                             } |                             } | ||||||
|                             break; |                             break; | ||||||
|                         case 0x08: |                         case 0x08: | ||||||
| //                            echo 'Picture Object<br />';
 |  | ||||||
|                             // picture
 |                             // picture
 | ||||||
|                             // get index to BSE entry (1-based)
 |                             // get index to BSE entry (1-based)
 | ||||||
|                             $BSEindex = $spContainer->getOPT(0x0104); |                             $BSEindex = $spContainer->getOPT(0x0104); | ||||||
| @ -1099,9 +1092,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|                             $noteDetails['objTextData']['text'] = ''; |                             $noteDetails['objTextData']['text'] = ''; | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
| //                    echo '<b>Cell annotation ', $note,'</b><br />';
 |  | ||||||
| //                    var_dump($noteDetails);
 |  | ||||||
| //                    echo '<br />';
 |  | ||||||
|                     $cellAddress = str_replace('$', '', $noteDetails['cellRef']); |                     $cellAddress = str_replace('$', '', $noteDetails['cellRef']); | ||||||
|                     $this->phpSheet->getComment($cellAddress)->setAuthor($noteDetails['author'])->setText($this->parseRichText($noteDetails['objTextData']['text'])); |                     $this->phpSheet->getComment($cellAddress)->setAuthor($noteDetails['author'])->setText($this->parseRichText($noteDetails['objTextData']['text'])); | ||||||
|                 } |                 } | ||||||
| @ -1275,8 +1265,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|         $this->summaryInformation = $ole->getStream($ole->summaryInformation); |         $this->summaryInformation = $ole->getStream($ole->summaryInformation); | ||||||
|         // Get additional document summary information data
 |         // Get additional document summary information data
 | ||||||
|         $this->documentSummaryInformation = $ole->getStream($ole->documentSummaryInformation); |         $this->documentSummaryInformation = $ole->getStream($ole->documentSummaryInformation); | ||||||
|         // Get user-defined property data
 |  | ||||||
| //        $this->userDefinedProperties = $ole->getUserDefinedProperties();
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -1429,21 +1417,17 @@ class Excel5 extends BaseReader implements IReader | |||||||
|         //    offset: 8;    size: 16
 |         //    offset: 8;    size: 16
 | ||||||
|         //    offset: 24;    size: 4;    section count
 |         //    offset: 24;    size: 4;    section count
 | ||||||
|         $secCount = self::getInt4d($this->documentSummaryInformation, 24); |         $secCount = self::getInt4d($this->documentSummaryInformation, 24); | ||||||
| //        echo '$secCount = ', $secCount,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|         // offset: 28;    size: 16;    first section's class id: 02 d5 cd d5 9c 2e 1b 10 93 97 08 00 2b 2c f9 ae
 |         // offset: 28;    size: 16;    first section's class id: 02 d5 cd d5 9c 2e 1b 10 93 97 08 00 2b 2c f9 ae
 | ||||||
|         // offset: 44;    size: 4;    first section offset
 |         // offset: 44;    size: 4;    first section offset
 | ||||||
|         $secOffset = self::getInt4d($this->documentSummaryInformation, 44); |         $secOffset = self::getInt4d($this->documentSummaryInformation, 44); | ||||||
| //        echo '$secOffset = ', $secOffset,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|         //    section header
 |         //    section header
 | ||||||
|         //    offset: $secOffset;    size: 4;    section length
 |         //    offset: $secOffset;    size: 4;    section length
 | ||||||
|         $secLength = self::getInt4d($this->documentSummaryInformation, $secOffset); |         $secLength = self::getInt4d($this->documentSummaryInformation, $secOffset); | ||||||
| //        echo '$secLength = ', $secLength,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|         //    offset: $secOffset+4;    size: 4;    property count
 |         //    offset: $secOffset+4;    size: 4;    property count
 | ||||||
|         $countProperties = self::getInt4d($this->documentSummaryInformation, $secOffset + 4); |         $countProperties = self::getInt4d($this->documentSummaryInformation, $secOffset + 4); | ||||||
| //        echo '$countProperties = ', $countProperties,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|         // initialize code page (used to resolve string values)
 |         // initialize code page (used to resolve string values)
 | ||||||
|         $codePage = 'CP1252'; |         $codePage = 'CP1252'; | ||||||
| @ -1451,17 +1435,14 @@ class Excel5 extends BaseReader implements IReader | |||||||
|         //    offset: ($secOffset+8);    size: var
 |         //    offset: ($secOffset+8);    size: var
 | ||||||
|         //    loop through property decarations and properties
 |         //    loop through property decarations and properties
 | ||||||
|         for ($i = 0; $i < $countProperties; ++$i) { |         for ($i = 0; $i < $countProperties; ++$i) { | ||||||
|             //            echo 'Property ', $i,'<br />';
 |  | ||||||
|             //    offset: ($secOffset+8) + (8 * $i);    size: 4;    property ID
 |             //    offset: ($secOffset+8) + (8 * $i);    size: 4;    property ID
 | ||||||
|             $id = self::getInt4d($this->documentSummaryInformation, ($secOffset + 8) + (8 * $i)); |             $id = self::getInt4d($this->documentSummaryInformation, ($secOffset + 8) + (8 * $i)); | ||||||
| //            echo 'ID is ', $id,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|             // Use value of property id as appropriate
 |             // Use value of property id as appropriate
 | ||||||
|             // offset: 60 + 8 * $i;    size: 4;    offset from beginning of section (48)
 |             // offset: 60 + 8 * $i;    size: 4;    offset from beginning of section (48)
 | ||||||
|             $offset = self::getInt4d($this->documentSummaryInformation, ($secOffset + 12) + (8 * $i)); |             $offset = self::getInt4d($this->documentSummaryInformation, ($secOffset + 12) + (8 * $i)); | ||||||
| 
 | 
 | ||||||
|             $type = self::getInt4d($this->documentSummaryInformation, $secOffset + $offset); |             $type = self::getInt4d($this->documentSummaryInformation, $secOffset + $offset); | ||||||
| //            echo 'Type is ', $type,', ';
 |  | ||||||
| 
 | 
 | ||||||
|             // initialize property value
 |             // initialize property value
 | ||||||
|             $value = null; |             $value = null; | ||||||
| @ -1555,7 +1536,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|     private function readDefault() |     private function readDefault() | ||||||
|     { |     { | ||||||
|         $length = self::getInt2d($this->data, $this->pos + 2); |         $length = self::getInt2d($this->data, $this->pos + 2); | ||||||
| //        $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
 |  | ||||||
| 
 | 
 | ||||||
|         // move stream pointer to next record
 |         // move stream pointer to next record
 | ||||||
|         $this->pos += 4 + $length; |         $this->pos += 4 + $length; | ||||||
| @ -1567,7 +1547,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|      */ |      */ | ||||||
|     private function readNote() |     private function readNote() | ||||||
|     { |     { | ||||||
|         //        echo '<b>Read Cell Annotation</b><br />';
 |  | ||||||
|         $length = self::getInt2d($this->data, $this->pos + 2); |         $length = self::getInt2d($this->data, $this->pos + 2); | ||||||
|         $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); |         $recordData = $this->readRecordData($this->data, $this->pos + 4, $length); | ||||||
| 
 | 
 | ||||||
| @ -1583,10 +1562,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|             $noteObjID = self::getInt2d($recordData, 6); |             $noteObjID = self::getInt2d($recordData, 6); | ||||||
|             $noteAuthor = self::readUnicodeStringLong(substr($recordData, 8)); |             $noteAuthor = self::readUnicodeStringLong(substr($recordData, 8)); | ||||||
|             $noteAuthor = $noteAuthor['value']; |             $noteAuthor = $noteAuthor['value']; | ||||||
| //            echo 'Note Address=', $cellAddress,'<br />';
 |  | ||||||
| //            echo 'Note Object ID=', $noteObjID,'<br />';
 |  | ||||||
| //            echo 'Note Author=', $noteAuthor,'<hr />';
 |  | ||||||
| //
 |  | ||||||
|             $this->cellNotes[$noteObjID] = [ |             $this->cellNotes[$noteObjID] = [ | ||||||
|                 'cellRef' => $cellAddress, |                 'cellRef' => $cellAddress, | ||||||
|                 'objectID' => $noteObjID, |                 'objectID' => $noteObjID, | ||||||
| @ -1602,13 +1577,10 @@ class Excel5 extends BaseReader implements IReader | |||||||
|                 $extension = true; |                 $extension = true; | ||||||
|                 $cellAddress = array_pop(array_keys($this->phpSheet->getComments())); |                 $cellAddress = array_pop(array_keys($this->phpSheet->getComments())); | ||||||
|             } |             } | ||||||
| //            echo 'Note Address=', $cellAddress,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|             $cellAddress = str_replace('$', '', $cellAddress); |             $cellAddress = str_replace('$', '', $cellAddress); | ||||||
|             $noteLength = self::getInt2d($recordData, 4); |             $noteLength = self::getInt2d($recordData, 4); | ||||||
|             $noteText = trim(substr($recordData, 6)); |             $noteText = trim(substr($recordData, 6)); | ||||||
| //            echo 'Note Length=', $noteLength,'<br />';
 |  | ||||||
| //            echo 'Note Text=', $noteText,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|             if ($extension) { |             if ($extension) { | ||||||
|                 //    Concatenate this extension with the currently set comment for the cell
 |                 //    Concatenate this extension with the currently set comment for the cell
 | ||||||
| @ -1656,10 +1628,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|             'alignment' => $grbitOpts, |             'alignment' => $grbitOpts, | ||||||
|             'rotation' => $rot, |             'rotation' => $rot, | ||||||
|         ]; |         ]; | ||||||
| 
 |  | ||||||
| //        echo '<b>_readTextObject()</b><br />';
 |  | ||||||
| //        var_dump($this->textObjects[$this->textObjRef]);
 |  | ||||||
| //        echo '<br />';
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -4192,10 +4160,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|             'grbitOpts' => $grbitOpts, |             'grbitOpts' => $grbitOpts, | ||||||
|         ]; |         ]; | ||||||
|         $this->textObjRef = $idObjID; |         $this->textObjRef = $idObjID; | ||||||
| 
 |  | ||||||
| //        echo '<b>_readObj()</b><br />';
 |  | ||||||
| //        var_dump(end($this->objs));
 |  | ||||||
| //        echo '<br />';
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
| @ -4280,8 +4244,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|         // move stream pointer to next record
 |         // move stream pointer to next record
 | ||||||
|         $this->pos += 4 + $length; |         $this->pos += 4 + $length; | ||||||
| 
 | 
 | ||||||
|         //var_dump(unpack("vrt/vgrbitFrt/V2reserved/vwScalePLV/vgrbit", $recordData));
 |  | ||||||
| 
 |  | ||||||
|         // offset: 0; size: 2; rt
 |         // offset: 0; size: 2; rt
 | ||||||
|         //->ignore
 |         //->ignore
 | ||||||
|         $rt = self::getInt2d($recordData, 0); |         $rt = self::getInt2d($recordData, 0); | ||||||
| @ -5057,22 +5019,18 @@ class Excel5 extends BaseReader implements IReader | |||||||
|                 // 1. BITMAPCOREHEADER
 |                 // 1. BITMAPCOREHEADER
 | ||||||
|                 // offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure
 |                 // offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure
 | ||||||
|                 $bcSize = self::getInt4d($iData, 0); |                 $bcSize = self::getInt4d($iData, 0); | ||||||
|     //            var_dump($bcSize);
 |  | ||||||
| 
 | 
 | ||||||
|                 // offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels
 |                 // offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels
 | ||||||
|                 $bcWidth = self::getInt2d($iData, 4); |                 $bcWidth = self::getInt2d($iData, 4); | ||||||
|     //            var_dump($bcWidth);
 |  | ||||||
| 
 | 
 | ||||||
|                 // offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels.
 |                 // offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels.
 | ||||||
|                 $bcHeight = self::getInt2d($iData, 6); |                 $bcHeight = self::getInt2d($iData, 6); | ||||||
|     //            var_dump($bcHeight);
 |  | ||||||
|                 $ih = imagecreatetruecolor($bcWidth, $bcHeight); |                 $ih = imagecreatetruecolor($bcWidth, $bcHeight); | ||||||
| 
 | 
 | ||||||
|                 // offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1
 |                 // offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1
 | ||||||
| 
 | 
 | ||||||
|                 // offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24
 |                 // offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24
 | ||||||
|                 $bcBitCount = self::getInt2d($iData, 10); |                 $bcBitCount = self::getInt2d($iData, 10); | ||||||
|     //            var_dump($bcBitCount);
 |  | ||||||
| 
 | 
 | ||||||
|                 $rgbString = substr($iData, 12); |                 $rgbString = substr($iData, 12); | ||||||
|                 $rgbTriples = []; |                 $rgbTriples = []; | ||||||
| @ -5205,21 +5163,9 @@ class Excel5 extends BaseReader implements IReader | |||||||
|         // offset: 2; size: sz
 |         // offset: 2; size: sz
 | ||||||
|         $formulaData = substr($formulaStructure, 2, $sz); |         $formulaData = substr($formulaStructure, 2, $sz); | ||||||
| 
 | 
 | ||||||
|         // for debug: dump the formula data
 |  | ||||||
|         //echo '<xmp>';
 |  | ||||||
|         //echo 'size: ' . $sz . "\n";
 |  | ||||||
|         //echo 'the entire formula data: ';
 |  | ||||||
|         //Debug::dump($formulaData);
 |  | ||||||
|         //echo "\n----\n";
 |  | ||||||
| 
 |  | ||||||
|         // offset: 2 + sz; size: variable (optional)
 |         // offset: 2 + sz; size: variable (optional)
 | ||||||
|         if (strlen($formulaStructure) > 2 + $sz) { |         if (strlen($formulaStructure) > 2 + $sz) { | ||||||
|             $additionalData = substr($formulaStructure, 2 + $sz); |             $additionalData = substr($formulaStructure, 2 + $sz); | ||||||
| 
 |  | ||||||
|             // for debug: dump the additional data
 |  | ||||||
|             //echo 'the entire additional data: ';
 |  | ||||||
|             //Debug::dump($additionalData);
 |  | ||||||
|             //echo "\n----\n";
 |  | ||||||
|         } else { |         } else { | ||||||
|             $additionalData = ''; |             $additionalData = ''; | ||||||
|         } |         } | ||||||
| @ -5243,9 +5189,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|         while (strlen($formulaData) > 0 and $token = $this->getNextToken($formulaData, $baseCell)) { |         while (strlen($formulaData) > 0 and $token = $this->getNextToken($formulaData, $baseCell)) { | ||||||
|             $tokens[] = $token; |             $tokens[] = $token; | ||||||
|             $formulaData = substr($formulaData, $token['size']); |             $formulaData = substr($formulaData, $token['size']); | ||||||
| 
 |  | ||||||
|             // for debug: dump the token
 |  | ||||||
|             //var_dump($token);
 |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $formulaString = $this->createFormulaFromTokens($tokens, $additionalData); |         $formulaString = $this->createFormulaFromTokens($tokens, $additionalData); | ||||||
| @ -5408,10 +5351,6 @@ class Excel5 extends BaseReader implements IReader | |||||||
|         } |         } | ||||||
|         $formulaString = $formulaStrings[0]; |         $formulaString = $formulaStrings[0]; | ||||||
| 
 | 
 | ||||||
|         // for debug: dump the human readable formula
 |  | ||||||
|         //echo '----' . "\n";
 |  | ||||||
|         //echo 'Formula: ' . $formulaString;
 |  | ||||||
| 
 |  | ||||||
|         return $formulaString; |         return $formulaString; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Reader; | namespace PhpSpreadsheet\Reader; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Reader\Exception |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -218,15 +218,9 @@ class Gnumeric extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|         $gFileData = $this->gzfileGetContents($pFilename); |         $gFileData = $this->gzfileGetContents($pFilename); | ||||||
| 
 | 
 | ||||||
| //        echo '<pre>';
 |  | ||||||
| //        echo htmlentities($gFileData,ENT_QUOTES,'UTF-8');
 |  | ||||||
| //        echo '</pre><hr />';
 |  | ||||||
| //
 |  | ||||||
|         $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); |         $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', \PhpSpreadsheet\Settings::getLibXmlLoaderOptions()); | ||||||
|         $namespacesMeta = $xml->getNamespaces(true); |         $namespacesMeta = $xml->getNamespaces(true); | ||||||
| 
 | 
 | ||||||
| //        var_dump($namespacesMeta);
 |  | ||||||
| //
 |  | ||||||
|         $gnmXML = $xml->children($namespacesMeta['gnm']); |         $gnmXML = $xml->children($namespacesMeta['gnm']); | ||||||
| 
 | 
 | ||||||
|         $docProps = $spreadsheet->getProperties(); |         $docProps = $spreadsheet->getProperties(); | ||||||
| @ -335,7 +329,6 @@ class Gnumeric extends BaseReader implements IReader | |||||||
|         $worksheetID = 0; |         $worksheetID = 0; | ||||||
|         foreach ($gnmXML->Sheets->Sheet as $sheet) { |         foreach ($gnmXML->Sheets->Sheet as $sheet) { | ||||||
|             $worksheetName = (string) $sheet->Name; |             $worksheetName = (string) $sheet->Name; | ||||||
| //            echo '<b>Worksheet: ', $worksheetName,'</b><br />';
 |  | ||||||
|             if ((isset($this->loadSheetsOnly)) && (!in_array($worksheetName, $this->loadSheetsOnly))) { |             if ((isset($this->loadSheetsOnly)) && (!in_array($worksheetName, $this->loadSheetsOnly))) { | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
| @ -407,9 +400,6 @@ class Gnumeric extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|                 $ValueType = $cellAttributes->ValueType; |                 $ValueType = $cellAttributes->ValueType; | ||||||
|                 $ExprID = (string) $cellAttributes->ExprID; |                 $ExprID = (string) $cellAttributes->ExprID; | ||||||
| //                echo 'Cell ', $column, $row,'<br />';
 |  | ||||||
| //                echo 'Type is ', $ValueType,'<br />';
 |  | ||||||
| //                echo 'Value is ', $cell,'<br />';
 |  | ||||||
|                 $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; |                 $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; | ||||||
|                 if ($ExprID > '') { |                 if ($ExprID > '') { | ||||||
|                     if (((string) $cell) > '') { |                     if (((string) $cell) > '') { | ||||||
| @ -418,7 +408,6 @@ class Gnumeric extends BaseReader implements IReader | |||||||
|                             'row' => $cellAttributes->Row, |                             'row' => $cellAttributes->Row, | ||||||
|                             'formula' => (string) $cell, |                             'formula' => (string) $cell, | ||||||
|                         ]; |                         ]; | ||||||
| //                        echo 'NEW EXPRESSION ', $ExprID,'<br />';
 |  | ||||||
|                     } else { |                     } else { | ||||||
|                         $expression = $this->expressions[$ExprID]; |                         $expression = $this->expressions[$ExprID]; | ||||||
| 
 | 
 | ||||||
| @ -429,8 +418,6 @@ class Gnumeric extends BaseReader implements IReader | |||||||
|                             $cellAttributes->Row - $expression['row'], |                             $cellAttributes->Row - $expression['row'], | ||||||
|                             $worksheetName |                             $worksheetName | ||||||
|                         ); |                         ); | ||||||
| //                        echo 'SHARED EXPRESSION ', $ExprID,'<br />';
 |  | ||||||
| //                        echo 'New Value is ', $cell,'<br />';
 |  | ||||||
|                     } |                     } | ||||||
|                     $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; |                     $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; | ||||||
|                 } else { |                 } else { | ||||||
| @ -470,8 +457,6 @@ class Gnumeric extends BaseReader implements IReader | |||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| //            echo '$maxCol=', $maxCol,'; $maxRow=', $maxRow,'<br />';
 |  | ||||||
| //
 |  | ||||||
|             foreach ($sheet->Styles->StyleRegion as $styleRegion) { |             foreach ($sheet->Styles->StyleRegion as $styleRegion) { | ||||||
|                 $styleAttributes = $styleRegion->attributes(); |                 $styleAttributes = $styleRegion->attributes(); | ||||||
|                 if (($styleAttributes['startRow'] <= $maxRow) && |                 if (($styleAttributes['startRow'] <= $maxRow) && | ||||||
| @ -484,11 +469,8 @@ class Gnumeric extends BaseReader implements IReader | |||||||
|                     $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; |                     $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; | ||||||
|                     $endRow += 1; |                     $endRow += 1; | ||||||
|                     $cellRange = $startColumn . $startRow . ':' . $endColumn . $endRow; |                     $cellRange = $startColumn . $startRow . ':' . $endColumn . $endRow; | ||||||
| //                    echo $cellRange,'<br />';
 |  | ||||||
| 
 | 
 | ||||||
|                     $styleAttributes = $styleRegion->Style->attributes(); |                     $styleAttributes = $styleRegion->Style->attributes(); | ||||||
| //                    var_dump($styleAttributes);
 |  | ||||||
| //                    echo '<br />';
 |  | ||||||
| 
 | 
 | ||||||
|                     //    We still set the number format mask for date/time values, even if readDataOnly is true
 |                     //    We still set the number format mask for date/time values, even if readDataOnly is true
 | ||||||
|                     if ((!$this->readDataOnly) || |                     if ((!$this->readDataOnly) || | ||||||
| @ -611,8 +593,6 @@ class Gnumeric extends BaseReader implements IReader | |||||||
|                             } |                             } | ||||||
| 
 | 
 | ||||||
|                             $fontAttributes = $styleRegion->Style->Font->attributes(); |                             $fontAttributes = $styleRegion->Style->Font->attributes(); | ||||||
| //                            var_dump($fontAttributes);
 |  | ||||||
| //                            echo '<br />';
 |  | ||||||
|                             $styleArray['font']['name'] = (string) $styleRegion->Style->Font; |                             $styleArray['font']['name'] = (string) $styleRegion->Style->Font; | ||||||
|                             $styleArray['font']['size'] = intval($fontAttributes['Unit']); |                             $styleArray['font']['size'] = intval($fontAttributes['Unit']); | ||||||
|                             $styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? true : false; |                             $styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? true : false; | ||||||
| @ -673,8 +653,6 @@ class Gnumeric extends BaseReader implements IReader | |||||||
|                                 $hyperlink = $styleRegion->Style->HyperLink->attributes(); |                                 $hyperlink = $styleRegion->Style->HyperLink->attributes(); | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
| //                        var_dump($styleArray);
 |  | ||||||
| //                        echo '<br />';
 |  | ||||||
|                         $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); |                         $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|  | |||||||
| @ -208,7 +208,6 @@ class HTML extends BaseReader implements IReader | |||||||
|             //    Simple String content
 |             //    Simple String content
 | ||||||
|             if (trim($cellContent) > '') { |             if (trim($cellContent) > '') { | ||||||
|                 //    Only actually write it if there's content in the string
 |                 //    Only actually write it if there's content in the string
 | ||||||
| //                echo 'FLUSH CELL: ' , $column , $row , ' => ' , $cellContent , '<br />';
 |  | ||||||
|                 //    Write to worksheet to be done here...
 |                 //    Write to worksheet to be done here...
 | ||||||
|                 //    ... we return the cell so we can mess about with styles more easily
 |                 //    ... we return the cell so we can mess about with styles more easily
 | ||||||
|                 $sheet->setCellValue($column . $row, $cellContent, true); |                 $sheet->setCellValue($column . $row, $cellContent, true); | ||||||
| @ -242,11 +241,8 @@ class HTML extends BaseReader implements IReader | |||||||
|                     //    TODO
 |                     //    TODO
 | ||||||
|                 } |                 } | ||||||
|             } elseif ($child instanceof DOMElement) { |             } elseif ($child instanceof DOMElement) { | ||||||
|                 //                echo '<b>DOM ELEMENT: </b>' , strtoupper($child->nodeName) , '<br />';
 |  | ||||||
| 
 |  | ||||||
|                 $attributeArray = []; |                 $attributeArray = []; | ||||||
|                 foreach ($child->attributes as $attribute) { |                 foreach ($child->attributes as $attribute) { | ||||||
|                     //                    echo '<b>ATTRIBUTE: </b>' , $attribute->name , ' => ' , $attribute->value , '<br />';
 |  | ||||||
|                     $attributeArray[$attribute->name] = $attribute->value; |                     $attributeArray[$attribute->name] = $attribute->value; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
| @ -274,7 +270,6 @@ class HTML extends BaseReader implements IReader | |||||||
|                     case 'em': |                     case 'em': | ||||||
|                     case 'strong': |                     case 'strong': | ||||||
|                     case 'b': |                     case 'b': | ||||||
| //                        echo 'STYLING, SPAN OR DIV<br />';
 |  | ||||||
|                         if ($cellContent > '') { |                         if ($cellContent > '') { | ||||||
|                             $cellContent .= ' '; |                             $cellContent .= ' '; | ||||||
|                         } |                         } | ||||||
| @ -282,7 +277,6 @@ class HTML extends BaseReader implements IReader | |||||||
|                         if ($cellContent > '') { |                         if ($cellContent > '') { | ||||||
|                             $cellContent .= ' '; |                             $cellContent .= ' '; | ||||||
|                         } |                         } | ||||||
| //                        echo 'END OF STYLING, SPAN OR DIV<br />';
 |  | ||||||
|                         break; |                         break; | ||||||
|                     case 'hr': |                     case 'hr': | ||||||
|                         $this->flushCell($sheet, $column, $row, $cellContent); |                         $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
| @ -304,14 +298,11 @@ class HTML extends BaseReader implements IReader | |||||||
|                             $this->flushCell($sheet, $column, $row, $cellContent); |                             $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
|                             ++$row; |                             ++$row; | ||||||
|                         } |                         } | ||||||
| //                        echo 'HARD LINE BREAK: ' , '<br />';
 |  | ||||||
|                         break; |                         break; | ||||||
|                     case 'a': |                     case 'a': | ||||||
| //                        echo 'START OF HYPERLINK: ' , '<br />';
 |  | ||||||
|                         foreach ($attributeArray as $attributeName => $attributeValue) { |                         foreach ($attributeArray as $attributeName => $attributeValue) { | ||||||
|                             switch ($attributeName) { |                             switch ($attributeName) { | ||||||
|                                 case 'href': |                                 case 'href': | ||||||
| //                                    echo 'Link to ' , $attributeValue , '<br />';
 |  | ||||||
|                                     $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue); |                                     $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue); | ||||||
|                                     if (isset($this->formats[$child->nodeName])) { |                                     if (isset($this->formats[$child->nodeName])) { | ||||||
|                                         $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); |                                         $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); | ||||||
| @ -321,7 +312,6 @@ class HTML extends BaseReader implements IReader | |||||||
|                         } |                         } | ||||||
|                         $cellContent .= ' '; |                         $cellContent .= ' '; | ||||||
|                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
| //                        echo 'END OF HYPERLINK:' , '<br />';
 |  | ||||||
|                         break; |                         break; | ||||||
|                     case 'h1': |                     case 'h1': | ||||||
|                     case 'h2': |                     case 'h2': | ||||||
| @ -335,17 +325,13 @@ class HTML extends BaseReader implements IReader | |||||||
|                         if ($this->tableLevel > 0) { |                         if ($this->tableLevel > 0) { | ||||||
|                             //    If we're inside a table, replace with a \n
 |                             //    If we're inside a table, replace with a \n
 | ||||||
|                             $cellContent .= "\n"; |                             $cellContent .= "\n"; | ||||||
| //                            echo 'LIST ENTRY: ' , '<br />';
 |  | ||||||
|                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
| //                            echo 'END OF LIST ENTRY:' , '<br />';
 |  | ||||||
|                         } else { |                         } else { | ||||||
|                             if ($cellContent > '') { |                             if ($cellContent > '') { | ||||||
|                                 $this->flushCell($sheet, $column, $row, $cellContent); |                                 $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
|                                 ++$row; |                                 ++$row; | ||||||
|                             } |                             } | ||||||
| //                            echo 'START OF PARAGRAPH: ' , '<br />';
 |  | ||||||
|                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
| //                            echo 'END OF PARAGRAPH:' , '<br />';
 |  | ||||||
|                             $this->flushCell($sheet, $column, $row, $cellContent); |                             $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
| 
 | 
 | ||||||
|                             if (isset($this->formats[$child->nodeName])) { |                             if (isset($this->formats[$child->nodeName])) { | ||||||
| @ -360,17 +346,13 @@ class HTML extends BaseReader implements IReader | |||||||
|                         if ($this->tableLevel > 0) { |                         if ($this->tableLevel > 0) { | ||||||
|                             //    If we're inside a table, replace with a \n
 |                             //    If we're inside a table, replace with a \n
 | ||||||
|                             $cellContent .= "\n"; |                             $cellContent .= "\n"; | ||||||
| //                            echo 'LIST ENTRY: ' , '<br />';
 |  | ||||||
|                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
| //                            echo 'END OF LIST ENTRY:' , '<br />';
 |  | ||||||
|                         } else { |                         } else { | ||||||
|                             if ($cellContent > '') { |                             if ($cellContent > '') { | ||||||
|                                 $this->flushCell($sheet, $column, $row, $cellContent); |                                 $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
|                             } |                             } | ||||||
|                             ++$row; |                             ++$row; | ||||||
| //                            echo 'LIST ENTRY: ' , '<br />';
 |  | ||||||
|                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                             $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
| //                            echo 'END OF LIST ENTRY:' , '<br />';
 |  | ||||||
|                             $this->flushCell($sheet, $column, $row, $cellContent); |                             $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
|                             $column = 'A'; |                             $column = 'A'; | ||||||
|                         } |                         } | ||||||
| @ -378,12 +360,10 @@ class HTML extends BaseReader implements IReader | |||||||
|                     case 'table': |                     case 'table': | ||||||
|                         $this->flushCell($sheet, $column, $row, $cellContent); |                         $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
|                         $column = $this->setTableStartColumn($column); |                         $column = $this->setTableStartColumn($column); | ||||||
| //                        echo 'START OF TABLE LEVEL ' , $this->tableLevel , '<br />';
 |  | ||||||
|                         if ($this->tableLevel > 1) { |                         if ($this->tableLevel > 1) { | ||||||
|                             --$row; |                             --$row; | ||||||
|                         } |                         } | ||||||
|                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
| //                        echo 'END OF TABLE LEVEL ' , $this->tableLevel , '<br />';
 |  | ||||||
|                         $column = $this->releaseTableStartColumn(); |                         $column = $this->releaseTableStartColumn(); | ||||||
|                         if ($this->tableLevel > 1) { |                         if ($this->tableLevel > 1) { | ||||||
|                             ++$column; |                             ++$column; | ||||||
| @ -398,16 +378,12 @@ class HTML extends BaseReader implements IReader | |||||||
|                     case 'tr': |                     case 'tr': | ||||||
|                         $column = $this->getTableStartColumn(); |                         $column = $this->getTableStartColumn(); | ||||||
|                         $cellContent = ''; |                         $cellContent = ''; | ||||||
| //                        echo 'START OF TABLE ' , $this->tableLevel , ' ROW<br />';
 |  | ||||||
|                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
|                         ++$row; |                         ++$row; | ||||||
| //                        echo 'END OF TABLE ' , $this->tableLevel , ' ROW<br />';
 |  | ||||||
|                         break; |                         break; | ||||||
|                     case 'th': |                     case 'th': | ||||||
|                     case 'td': |                     case 'td': | ||||||
| //                        echo 'START OF TABLE ' , $this->tableLevel , ' CELL<br />';
 |  | ||||||
|                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); |                         $this->processDomElement($child, $sheet, $row, $column, $cellContent); | ||||||
| //                        echo 'END OF TABLE ' , $this->tableLevel , ' CELL<br />';
 |  | ||||||
| 
 | 
 | ||||||
|                         while (isset($this->rowspan[$column . $row])) { |                         while (isset($this->rowspan[$column . $row])) { | ||||||
|                             ++$column; |                             ++$column; | ||||||
| @ -415,14 +391,6 @@ class HTML extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|                         $this->flushCell($sheet, $column, $row, $cellContent); |                         $this->flushCell($sheet, $column, $row, $cellContent); | ||||||
| 
 | 
 | ||||||
| //                        if (isset($attributeArray['style']) && !empty($attributeArray['style'])) {
 |  | ||||||
| //                            $styleAry = $this->getPhpSpreadsheetStyleArray($attributeArray['style']);
 |  | ||||||
| //
 |  | ||||||
| //                            if (!empty($styleAry)) {
 |  | ||||||
| //                                $sheet->getStyle($column . $row)->applyFromArray($styleAry);
 |  | ||||||
| //                            }
 |  | ||||||
| //                        }
 |  | ||||||
| 
 |  | ||||||
|                         if (isset($attributeArray['rowspan']) && isset($attributeArray['colspan'])) { |                         if (isset($attributeArray['rowspan']) && isset($attributeArray['colspan'])) { | ||||||
|                             //create merging rowspan and colspan
 |                             //create merging rowspan and colspan
 | ||||||
|                             $columnTo = $column; |                             $columnTo = $column; | ||||||
|  | |||||||
| @ -242,41 +242,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                     $worksheetInfo[] = $tmpInfo; |                     $worksheetInfo[] = $tmpInfo; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| 
 |  | ||||||
| //                foreach ($workbookData->table as $worksheetDataSet) {
 |  | ||||||
| //                    $worksheetData = $worksheetDataSet->children($namespacesContent['table']);
 |  | ||||||
| //                    $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']);
 |  | ||||||
| //
 |  | ||||||
| //                    $rowIndex = 0;
 |  | ||||||
| //                    foreach ($worksheetData as $key => $rowData) {
 |  | ||||||
| //                        switch ($key) {
 |  | ||||||
| //                            case 'table-row' :
 |  | ||||||
| //                                $rowDataTableAttributes = $rowData->attributes($namespacesContent['table']);
 |  | ||||||
| //                                $rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ?
 |  | ||||||
| //                                        $rowDataTableAttributes['number-rows-repeated'] : 1;
 |  | ||||||
| //                                $columnIndex = 0;
 |  | ||||||
| //
 |  | ||||||
| //                                foreach ($rowData as $key => $cellData) {
 |  | ||||||
| //                                    $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']);
 |  | ||||||
| //                                    $colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ?
 |  | ||||||
| //                                        $cellDataTableAttributes['number-columns-repeated'] : 1;
 |  | ||||||
| //                                    $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']);
 |  | ||||||
| //                                    if (isset($cellDataOfficeAttributes['value-type'])) {
 |  | ||||||
| //                                        $tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex + $colRepeats - 1);
 |  | ||||||
| //                                        $tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex + $rowRepeats);
 |  | ||||||
| //                                    }
 |  | ||||||
| //                                    $columnIndex += $colRepeats;
 |  | ||||||
| //                                }
 |  | ||||||
| //                                $rowIndex += $rowRepeats;
 |  | ||||||
| //                                break;
 |  | ||||||
| //                        }
 |  | ||||||
| //                    }
 |  | ||||||
| //
 |  | ||||||
| //                    $tmpInfo['lastColumnLetter'] = \PhpSpreadsheet\Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
 |  | ||||||
| //                    $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1;
 |  | ||||||
| //
 |  | ||||||
| //                }
 |  | ||||||
| //            }
 |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return $worksheetInfo; |         return $worksheetInfo; | ||||||
| @ -337,16 +302,12 @@ class OOCalc extends BaseReader implements IReader | |||||||
|             throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); |             throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| //        echo '<h1>Meta Information</h1>';
 |  | ||||||
|         $xml = simplexml_load_string( |         $xml = simplexml_load_string( | ||||||
|             $this->securityScan($zip->getFromName('meta.xml')), |             $this->securityScan($zip->getFromName('meta.xml')), | ||||||
|             'SimpleXMLElement', |             'SimpleXMLElement', | ||||||
|             \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |             \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() | ||||||
|         ); |         ); | ||||||
|         $namespacesMeta = $xml->getNamespaces(true); |         $namespacesMeta = $xml->getNamespaces(true); | ||||||
| //        echo '<pre>';
 |  | ||||||
| //        print_r($namespacesMeta);
 |  | ||||||
| //        echo '</pre><hr />';
 |  | ||||||
| 
 | 
 | ||||||
|         $docProps = $spreadsheet->getProperties(); |         $docProps = $spreadsheet->getProperties(); | ||||||
|         $officeProperty = $xml->children($namespacesMeta['office']); |         $officeProperty = $xml->children($namespacesMeta['office']); | ||||||
| @ -426,16 +387,12 @@ class OOCalc extends BaseReader implements IReader | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| //        echo '<h1>Workbook Content</h1>';
 |  | ||||||
|         $xml = simplexml_load_string( |         $xml = simplexml_load_string( | ||||||
|             $this->securityScan($zip->getFromName('content.xml')), |             $this->securityScan($zip->getFromName('content.xml')), | ||||||
|             'SimpleXMLElement', |             'SimpleXMLElement', | ||||||
|             \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |             \PhpSpreadsheet\Settings::getLibXmlLoaderOptions() | ||||||
|         ); |         ); | ||||||
|         $namespacesContent = $xml->getNamespaces(true); |         $namespacesContent = $xml->getNamespaces(true); | ||||||
| //        echo '<pre>';
 |  | ||||||
| //        print_r($namespacesContent);
 |  | ||||||
| //        echo '</pre><hr />';
 |  | ||||||
| 
 | 
 | ||||||
|         $workbook = $xml->children($namespacesContent['office']); |         $workbook = $xml->children($namespacesContent['office']); | ||||||
|         foreach ($workbook->body->spreadsheet as $workbookData) { |         foreach ($workbook->body->spreadsheet as $workbookData) { | ||||||
| @ -443,17 +400,12 @@ class OOCalc extends BaseReader implements IReader | |||||||
|             $worksheetID = 0; |             $worksheetID = 0; | ||||||
|             foreach ($workbookData->table as $worksheetDataSet) { |             foreach ($workbookData->table as $worksheetDataSet) { | ||||||
|                 $worksheetData = $worksheetDataSet->children($namespacesContent['table']); |                 $worksheetData = $worksheetDataSet->children($namespacesContent['table']); | ||||||
| //                print_r($worksheetData);
 |  | ||||||
| //                echo '<br />';
 |  | ||||||
|                 $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); |                 $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); | ||||||
| //                print_r($worksheetDataAttributes);
 |  | ||||||
| //                echo '<br />';
 |  | ||||||
|                 if ((isset($this->loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) && |                 if ((isset($this->loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) && | ||||||
|                     (!in_array($worksheetDataAttributes['name'], $this->loadSheetsOnly))) { |                     (!in_array($worksheetDataAttributes['name'], $this->loadSheetsOnly))) { | ||||||
|                     continue; |                     continue; | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
| //                echo '<h2>Worksheet '.$worksheetDataAttributes['name'].'</h2>';
 |  | ||||||
|                 // Create new Worksheet
 |                 // Create new Worksheet
 | ||||||
|                 $spreadsheet->createSheet(); |                 $spreadsheet->createSheet(); | ||||||
|                 $spreadsheet->setActiveSheetIndex($worksheetID); |                 $spreadsheet->setActiveSheetIndex($worksheetID); | ||||||
| @ -467,7 +419,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|                 $rowID = 1; |                 $rowID = 1; | ||||||
|                 foreach ($worksheetData as $key => $rowData) { |                 foreach ($worksheetData as $key => $rowData) { | ||||||
|                     //                    echo '<b>'.$key.'</b><br />';
 |  | ||||||
|                     switch ($key) { |                     switch ($key) { | ||||||
|                         case 'table-header-rows': |                         case 'table-header-rows': | ||||||
|                             foreach ($rowData as $keyRowData => $cellData) { |                             foreach ($rowData as $keyRowData => $cellData) { | ||||||
| @ -486,20 +437,11 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                                     } |                                     } | ||||||
|                                 } |                                 } | ||||||
| 
 | 
 | ||||||
| //                                echo '<b>'.$columnID.$rowID.'</b><br />';
 |  | ||||||
|                                 $cellDataText = (isset($namespacesContent['text'])) ? $cellData->children($namespacesContent['text']) : ''; |                                 $cellDataText = (isset($namespacesContent['text'])) ? $cellData->children($namespacesContent['text']) : ''; | ||||||
|                                 $cellDataOffice = $cellData->children($namespacesContent['office']); |                                 $cellDataOffice = $cellData->children($namespacesContent['office']); | ||||||
|                                 $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']); |                                 $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']); | ||||||
|                                 $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']); |                                 $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']); | ||||||
| 
 | 
 | ||||||
| //                                echo 'Office Attributes: ';
 |  | ||||||
| //                                print_r($cellDataOfficeAttributes);
 |  | ||||||
| //                                echo '<br />Table Attributes: ';
 |  | ||||||
| //                                print_r($cellDataTableAttributes);
 |  | ||||||
| //                                echo '<br />Cell Data Text';
 |  | ||||||
| //                                print_r($cellDataText);
 |  | ||||||
| //                                echo '<br />';
 |  | ||||||
| //
 |  | ||||||
|                                 $type = $formatting = $hyperlink = null; |                                 $type = $formatting = $hyperlink = null; | ||||||
|                                 $hasCalculatedValue = false; |                                 $hasCalculatedValue = false; | ||||||
|                                 $cellDataFormula = ''; |                                 $cellDataFormula = ''; | ||||||
| @ -509,7 +451,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                                 } |                                 } | ||||||
| 
 | 
 | ||||||
|                                 if (isset($cellDataOffice->annotation)) { |                                 if (isset($cellDataOffice->annotation)) { | ||||||
|                                     //                                    echo 'Cell has comment<br />';
 |  | ||||||
|                                     $annotationText = $cellDataOffice->annotation->children($namespacesContent['text']); |                                     $annotationText = $cellDataOffice->annotation->children($namespacesContent['text']); | ||||||
|                                     $textArray = []; |                                     $textArray = []; | ||||||
|                                     foreach ($annotationText as $t) { |                                     foreach ($annotationText as $t) { | ||||||
| @ -522,7 +463,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                                         } |                                         } | ||||||
|                                     } |                                     } | ||||||
|                                     $text = implode("\n", $textArray); |                                     $text = implode("\n", $textArray); | ||||||
| //                                    echo $text, '<br />';
 |  | ||||||
|                                     $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setText($this->parseRichText($text)); |                                     $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setText($this->parseRichText($text)); | ||||||
| //                                                                    ->setAuthor( $author )
 | //                                                                    ->setAuthor( $author )
 | ||||||
|                                 } |                                 } | ||||||
| @ -548,7 +488,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                                     } |                                     } | ||||||
|                                     $allCellDataText = implode($dataArray, "\n"); |                                     $allCellDataText = implode($dataArray, "\n"); | ||||||
| 
 | 
 | ||||||
| //                                    echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />';
 |  | ||||||
|                                     switch ($cellDataOfficeAttributes['value-type']) { |                                     switch ($cellDataOfficeAttributes['value-type']) { | ||||||
|                                         case 'string': |                                         case 'string': | ||||||
|                                             $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; |                                             $type = \PhpSpreadsheet\Cell\DataType::TYPE_STRING; | ||||||
| @ -608,10 +547,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                                             $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; |                                             $formatting = \PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; | ||||||
|                                             break; |                                             break; | ||||||
|                                     } |                                     } | ||||||
| //                                    echo 'Data value is '.$dataValue.'<br />';
 |  | ||||||
| //                                    if ($hyperlink !== null) {
 |  | ||||||
| //                                        echo 'Hyperlink is '.$hyperlink.'<br />';
 |  | ||||||
| //                                    }
 |  | ||||||
|                                 } else { |                                 } else { | ||||||
|                                     $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; |                                     $type = \PhpSpreadsheet\Cell\DataType::TYPE_NULL; | ||||||
|                                     $dataValue = null; |                                     $dataValue = null; | ||||||
| @ -619,7 +554,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
| 
 | 
 | ||||||
|                                 if ($hasCalculatedValue) { |                                 if ($hasCalculatedValue) { | ||||||
|                                     $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; |                                     $type = \PhpSpreadsheet\Cell\DataType::TYPE_FORMULA; | ||||||
| //                                    echo 'Formula: ', $cellDataFormula, PHP_EOL;
 |  | ||||||
|                                     $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=') + 1); |                                     $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=') + 1); | ||||||
|                                     $temp = explode('"', $cellDataFormula); |                                     $temp = explode('"', $cellDataFormula); | ||||||
|                                     $tKey = false; |                                     $tKey = false; | ||||||
| @ -636,7 +570,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                                     unset($value); |                                     unset($value); | ||||||
|                                     //    Then rebuild the formula string
 |                                     //    Then rebuild the formula string
 | ||||||
|                                     $cellDataFormula = implode('"', $temp); |                                     $cellDataFormula = implode('"', $temp); | ||||||
| //                                    echo 'Adjusted Formula: ', $cellDataFormula, PHP_EOL;
 |  | ||||||
|                                 } |                                 } | ||||||
| 
 | 
 | ||||||
|                                 $colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ? $cellDataTableAttributes['number-columns-repeated'] : 1; |                                 $colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ? $cellDataTableAttributes['number-columns-repeated'] : 1; | ||||||
| @ -650,7 +583,6 @@ class OOCalc extends BaseReader implements IReader | |||||||
|                                                 $rID = $rowID + $rowAdjust; |                                                 $rID = $rowID + $rowAdjust; | ||||||
|                                                 $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); |                                                 $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); | ||||||
|                                                 if ($hasCalculatedValue) { |                                                 if ($hasCalculatedValue) { | ||||||
|                                                     //                                                    echo 'Forumla result is '.$dataValue.'<br />';
 |  | ||||||
|                                                     $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setCalculatedValue($dataValue); |                                                     $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setCalculatedValue($dataValue); | ||||||
|                                                 } |                                                 } | ||||||
|                                                 if ($formatting !== null) { |                                                 if ($formatting !== null) { | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared; | namespace PhpSpreadsheet\Shared; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\CodePage |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared; | namespace PhpSpreadsheet\Shared; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\Date |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared; | namespace PhpSpreadsheet\Shared; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\File |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared; | namespace PhpSpreadsheet\Shared; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\Font |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -309,13 +307,9 @@ class Font | |||||||
| 
 | 
 | ||||||
|         // Get corners positions
 |         // Get corners positions
 | ||||||
|         $lowerLeftCornerX = $textBox[0]; |         $lowerLeftCornerX = $textBox[0]; | ||||||
| //        $lowerLeftCornerY  = $textBox[1];
 |  | ||||||
|         $lowerRightCornerX = $textBox[2]; |         $lowerRightCornerX = $textBox[2]; | ||||||
| //        $lowerRightCornerY = $textBox[3];
 |  | ||||||
|         $upperRightCornerX = $textBox[4]; |         $upperRightCornerX = $textBox[4]; | ||||||
| //        $upperRightCornerY = $textBox[5];
 |  | ||||||
|         $upperLeftCornerX = $textBox[6]; |         $upperLeftCornerX = $textBox[6]; | ||||||
| //        $upperLeftCornerY  = $textBox[7];
 |  | ||||||
| 
 | 
 | ||||||
|         // Consider the rotation when calculating the width
 |         // Consider the rotation when calculating the width
 | ||||||
|         $textWidth = max($lowerRightCornerX - $upperLeftCornerX, $upperRightCornerX - $lowerLeftCornerX); |         $textWidth = max($lowerRightCornerX - $upperLeftCornerX, $upperRightCornerX - $lowerLeftCornerX); | ||||||
| @ -345,8 +339,6 @@ class Font | |||||||
|                 break; |                 break; | ||||||
| 
 | 
 | ||||||
|             case 'Arial': |             case 'Arial': | ||||||
|                 // value 7 was found via interpolation by inspecting real Excel files with Arial 10 font.
 |  | ||||||
| //                $columnWidth = (int) (7 * String::countCharacters($columnText));
 |  | ||||||
|                 // value 8 was set because of experience in different exports at Arial 10 font.
 |                 // value 8 was set because of experience in different exports at Arial 10 font.
 | ||||||
|                 $columnWidth = (int) (8 * StringHelper::countCharacters($columnText)); |                 $columnWidth = (int) (8 * StringHelper::countCharacters($columnText)); | ||||||
|                 $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
 |                 $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
 | ||||||
|  | |||||||
| @ -20,7 +20,6 @@ namespace PhpSpreadsheet\Shared; | |||||||
| // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | ||||||
| // +----------------------------------------------------------------------+
 | // +----------------------------------------------------------------------+
 | ||||||
| //
 | //
 | ||||||
| // $Id: OLE.php,v 1.13 2007/03/07 14:38:25 schmidt Exp $
 |  | ||||||
| 
 | 
 | ||||||
| /* | /* | ||||||
| * Array for storing OLE instances that are accessed from | * Array for storing OLE instances that are accessed from | ||||||
| @ -156,8 +155,7 @@ class OLE | |||||||
|             $pos = $this->_getBlockOffset(self::_readInt4($fh)); |             $pos = $this->_getBlockOffset(self::_readInt4($fh)); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Read Big Block Allocation Table according to chain specified by
 |         // Read Big Block Allocation Table according to chain specified by $mbatBlocks
 | ||||||
|         // $mbatBlocks
 |  | ||||||
|         for ($i = 0; $i < $bbatBlockCount; ++$i) { |         for ($i = 0; $i < $bbatBlockCount; ++$i) { | ||||||
|             $pos = $this->_getBlockOffset($mbatBlocks[$i]); |             $pos = $this->_getBlockOffset($mbatBlocks[$i]); | ||||||
|             fseek($fh, $pos); |             fseek($fh, $pos); | ||||||
|  | |||||||
| @ -20,7 +20,6 @@ namespace PhpSpreadsheet\Shared\OLE; | |||||||
| // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | ||||||
| // +----------------------------------------------------------------------+
 | // +----------------------------------------------------------------------+
 | ||||||
| //
 | //
 | ||||||
| // $Id: PPS.php,v 1.7 2007/02/13 21:00:42 schmidt Exp $
 |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Class for creating PPS's for OLE containers |  * Class for creating PPS's for OLE containers | ||||||
| @ -151,13 +150,8 @@ class PPS | |||||||
|         if (!isset($this->_data)) { |         if (!isset($this->_data)) { | ||||||
|             return 0; |             return 0; | ||||||
|         } |         } | ||||||
|         //if (isset($this->_PPS_FILE)) {
 | 
 | ||||||
|         //    fseek($this->_PPS_FILE, 0);
 |         return strlen($this->_data); | ||||||
|         //    $stats = fstat($this->_PPS_FILE);
 |  | ||||||
|         //    return $stats[7];
 |  | ||||||
|         //} else {
 |  | ||||||
|             return strlen($this->_data); |  | ||||||
|         //}
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -20,7 +20,6 @@ namespace PhpSpreadsheet\Shared\OLE\PPS; | |||||||
| // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | ||||||
| // +----------------------------------------------------------------------+
 | // +----------------------------------------------------------------------+
 | ||||||
| //
 | //
 | ||||||
| // $Id: File.php,v 1.11 2007/02/13 21:00:42 schmidt Exp $
 |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Class for creating File PPS's for OLE containers |  * Class for creating File PPS's for OLE containers | ||||||
|  | |||||||
| @ -20,7 +20,6 @@ namespace PhpSpreadsheet\Shared\OLE\PPS; | |||||||
| // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
 | ||||||
| // +----------------------------------------------------------------------+
 | // +----------------------------------------------------------------------+
 | ||||||
| //
 | //
 | ||||||
| // $Id: Root.php,v 1.9 2005/04/23 21:53:49 dufuz Exp $
 |  | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Class for creating Root PPS's for OLE containers |  * Class for creating Root PPS's for OLE containers | ||||||
| @ -260,17 +259,7 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS | |||||||
|             if ($raList[$i]->Type != \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_DIR) { |             if ($raList[$i]->Type != \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_DIR) { | ||||||
|                 $raList[$i]->Size = $raList[$i]->getDataLen(); |                 $raList[$i]->Size = $raList[$i]->getDataLen(); | ||||||
|                 if (($raList[$i]->Size >= \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { |                 if (($raList[$i]->Size >= \PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PhpSpreadsheet\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { | ||||||
|                     // Write Data
 |                     fwrite($FILE, $raList[$i]->_data); | ||||||
|                     //if (isset($raList[$i]->_PPS_FILE)) {
 |  | ||||||
|                     //    $iLen = 0;
 |  | ||||||
|                     //    fseek($raList[$i]->_PPS_FILE, 0); // To The Top
 |  | ||||||
|                     //    while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
 |  | ||||||
|                     //        $iLen += strlen($sBuff);
 |  | ||||||
|                     //        fwrite($FILE, $sBuff);
 |  | ||||||
|                     //    }
 |  | ||||||
|                     //} else {
 |  | ||||||
|                         fwrite($FILE, $raList[$i]->_data); |  | ||||||
|                     //}
 |  | ||||||
| 
 | 
 | ||||||
|                     if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) { |                     if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) { | ||||||
|                         fwrite($FILE, str_repeat("\x00", $this->_BIG_BLOCK_SIZE - ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE))); |                         fwrite($FILE, str_repeat("\x00", $this->_BIG_BLOCK_SIZE - ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE))); | ||||||
| @ -281,12 +270,6 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS | |||||||
|                             (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + |                             (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + | ||||||
|                                 (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); |                                 (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) ? 1 : 0)); | ||||||
|                 } |                 } | ||||||
|                 // Close file for each PPS, and unlink it
 |  | ||||||
|                 //if (isset($raList[$i]->_PPS_FILE)) {
 |  | ||||||
|                 //    fclose($raList[$i]->_PPS_FILE);
 |  | ||||||
|                 //    $raList[$i]->_PPS_FILE = null;
 |  | ||||||
|                 //    unlink($raList[$i]->_tmp_filename);
 |  | ||||||
|                 //}
 |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -319,15 +302,8 @@ class Root extends \PhpSpreadsheet\Shared\OLE\PPS | |||||||
|                     } |                     } | ||||||
|                     fwrite($FILE, pack('V', -2)); |                     fwrite($FILE, pack('V', -2)); | ||||||
| 
 | 
 | ||||||
|                     //// Add to Data String(this will be written for RootEntry)
 |                     // Add to Data String(this will be written for RootEntry)
 | ||||||
|                     //if ($raList[$i]->_PPS_FILE) {
 |                     $sRes .= $raList[$i]->_data; | ||||||
|                     //    fseek($raList[$i]->_PPS_FILE, 0); // To The Top
 |  | ||||||
|                     //    while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
 |  | ||||||
|                     //        $sRes .= $sBuff;
 |  | ||||||
|                     //    }
 |  | ||||||
|                     //} else {
 |  | ||||||
|                         $sRes .= $raList[$i]->_data; |  | ||||||
|                     //}
 |  | ||||||
|                     if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) { |                     if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) { | ||||||
|                         $sRes .= str_repeat("\x00", $this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)); |                         $sRes .= str_repeat("\x00", $this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)); | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -281,13 +281,11 @@ class OLERead | |||||||
| 
 | 
 | ||||||
|             // Summary information
 |             // Summary information
 | ||||||
|             if ($name == chr(5) . 'SummaryInformation') { |             if ($name == chr(5) . 'SummaryInformation') { | ||||||
|                 //                echo 'Summary Information<br />';
 |  | ||||||
|                 $this->summaryInformation = count($this->props) - 1; |                 $this->summaryInformation = count($this->props) - 1; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             // Additional Document Summary information
 |             // Additional Document Summary information
 | ||||||
|             if ($name == chr(5) . 'DocumentSummaryInformation') { |             if ($name == chr(5) . 'DocumentSummaryInformation') { | ||||||
|                 //                echo 'Document Summary Information<br />';
 |  | ||||||
|                 $this->documentSummaryInformation = count($this->props) - 1; |                 $this->documentSummaryInformation = count($this->props) - 1; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -25,8 +25,6 @@ namespace PhpSpreadsheet\Shared\PCLZip; | |||||||
| //     The use of this software is at the risk of the user.
 | //     The use of this software is at the risk of the user.
 | ||||||
| //
 | //
 | ||||||
| // --------------------------------------------------------------------------------
 | // --------------------------------------------------------------------------------
 | ||||||
| // $Id: PclZip.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $
 |  | ||||||
| // --------------------------------------------------------------------------------
 |  | ||||||
| 
 | 
 | ||||||
| // ----- Constants
 | // ----- Constants
 | ||||||
| if (!defined('PCLZIP_READ_BLOCK_SIZE')) { | if (!defined('PCLZIP_READ_BLOCK_SIZE')) { | ||||||
| @ -688,7 +686,6 @@ class PclZip | |||||||
| 
 | 
 | ||||||
|         // ----- Set default values
 |         // ----- Set default values
 | ||||||
|         $v_options = []; |         $v_options = []; | ||||||
|     //        $v_path = "./";
 |  | ||||||
|         $v_path = ''; |         $v_path = ''; | ||||||
|         $v_remove_path = ''; |         $v_remove_path = ''; | ||||||
|         $v_remove_all_path = false; |         $v_remove_all_path = false; | ||||||
| @ -839,7 +836,6 @@ class PclZip | |||||||
| 
 | 
 | ||||||
|         // ----- Set default values
 |         // ----- Set default values
 | ||||||
|         $v_options = []; |         $v_options = []; | ||||||
|     //        $v_path = "./";
 |  | ||||||
|         $v_path = ''; |         $v_path = ''; | ||||||
|         $v_remove_path = ''; |         $v_remove_path = ''; | ||||||
|         $v_remove_all_path = false; |         $v_remove_all_path = false; | ||||||
| @ -2726,7 +2722,6 @@ class PclZip | |||||||
|         while ($v_size != 0) { |         while ($v_size != 0) { | ||||||
|             $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); |             $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); | ||||||
|             $v_buffer = @fread($v_file_compressed, $v_read_size); |             $v_buffer = @fread($v_file_compressed, $v_read_size); | ||||||
|             //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
 |  | ||||||
|             @fwrite($this->zip_fd, $v_buffer, $v_read_size); |             @fwrite($this->zip_fd, $v_buffer, $v_read_size); | ||||||
|             $v_size -= $v_read_size; |             $v_size -= $v_read_size; | ||||||
|         } |         } | ||||||
| @ -3690,7 +3685,6 @@ class PclZip | |||||||
|         while ($v_size != 0) { |         while ($v_size != 0) { | ||||||
|             $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); |             $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); | ||||||
|             $v_buffer = @gzread($v_src_file, $v_read_size); |             $v_buffer = @gzread($v_src_file, $v_read_size); | ||||||
|             //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
 |  | ||||||
|             @fwrite($v_dest_file, $v_buffer, $v_read_size); |             @fwrite($v_dest_file, $v_buffer, $v_read_size); | ||||||
|             $v_size -= $v_read_size; |             $v_size -= $v_read_size; | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared; | namespace PhpSpreadsheet\Shared; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\PasswordHasher |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared; | namespace PhpSpreadsheet\Shared; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\StringHelper |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -43,7 +41,7 @@ class StringHelper | |||||||
|     /** |     /** | ||||||
|      * SYLK Characters array |      * SYLK Characters array | ||||||
|      * |      * | ||||||
|      * $var array |      * @var array | ||||||
|      */ |      */ | ||||||
|     private static $SYLKCharacters = []; |     private static $SYLKCharacters = []; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared; | namespace PhpSpreadsheet\Shared; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\TimeZone |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -398,11 +398,9 @@ class BestFit | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // calculate slope
 |         // calculate slope
 | ||||||
| //        $this->slope = (($this->valueCount * $xy_sum) - ($x_sum * $y_sum)) / (($this->valueCount * $xx_sum) - ($x_sum * $x_sum));
 |  | ||||||
|         $this->slope = $mBase / $mDivisor; |         $this->slope = $mBase / $mDivisor; | ||||||
| 
 | 
 | ||||||
|         // calculate intersect
 |         // calculate intersect
 | ||||||
| //        $this->intersect = ($y_sum - ($this->slope * $x_sum)) / $this->valueCount;
 |  | ||||||
|         if ($const) { |         if ($const) { | ||||||
|             $this->intersect = $meanY - ($this->slope * $meanX); |             $this->intersect = $meanY - ($this->slope * $meanX); | ||||||
|         } else { |         } else { | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Shared\Trend; | namespace PhpSpreadsheet\Shared\Trend; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Shared\Trend\powerBestFit |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Style; | namespace PhpSpreadsheet\Style; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Style\NumberFormat |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -688,7 +686,6 @@ class NumberFormat extends Supervisor implements \PhpSpreadsheet\IComparable | |||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if (preg_match('/#?.*\?\/\?/', $format, $m)) { |                 if (preg_match('/#?.*\?\/\?/', $format, $m)) { | ||||||
|                     //echo 'Format mask is fractional '.$format.' <br />';
 |  | ||||||
|                     if ($value != (int) $value) { |                     if ($value != (int) $value) { | ||||||
|                         self::formatAsFraction($value, $format); |                         self::formatAsFraction($value, $format); | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -2647,15 +2647,7 @@ class Worksheet implements IComparable | |||||||
|     { |     { | ||||||
|         // Flush cache
 |         // Flush cache
 | ||||||
|         $this->cellCollection->getCacheData('A1'); |         $this->cellCollection->getCacheData('A1'); | ||||||
|         // Build a reference table from images
 | 
 | ||||||
| //        $imageCoordinates = array();
 |  | ||||||
| //        $iterator = $this->getDrawingCollection()->getIterator();
 |  | ||||||
| //        while ($iterator->valid()) {
 |  | ||||||
| //            $imageCoordinates[$iterator->current()->getCoordinates()] = true;
 |  | ||||||
| //
 |  | ||||||
| //            $iterator->next();
 |  | ||||||
| //        }
 |  | ||||||
| //
 |  | ||||||
|         // Lookup highest column and highest row if cells are cleaned
 |         // Lookup highest column and highest row if cells are cleaned
 | ||||||
|         $colRow = $this->cellCollection->getHighestRowAndColumn(); |         $colRow = $this->cellCollection->getHighestRowAndColumn(); | ||||||
|         $highestRow = $colRow['row']; |         $highestRow = $colRow['row']; | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\AutoFilter |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -593,7 +591,6 @@ class AutoFilter | |||||||
|         list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); |         list($rangeStart, $rangeEnd) = \PhpSpreadsheet\Cell::rangeBoundaries($this->range); | ||||||
| 
 | 
 | ||||||
|         //    The heading row should always be visible
 |         //    The heading row should always be visible
 | ||||||
| //        echo 'AutoFilter Heading Row ', $rangeStart[1],' is always SHOWN',PHP_EOL;
 |  | ||||||
|         $this->workSheet->getRowDimension($rangeStart[1])->setVisible(true); |         $this->workSheet->getRowDimension($rangeStart[1])->setVisible(true); | ||||||
| 
 | 
 | ||||||
|         $columnFilterTests = []; |         $columnFilterTests = []; | ||||||
| @ -774,31 +771,23 @@ class AutoFilter | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| //        echo 'Column Filter Test CRITERIA',PHP_EOL;
 |  | ||||||
| //        var_dump($columnFilterTests);
 |  | ||||||
| //
 |  | ||||||
|         //    Execute the column tests for each row in the autoFilter range to determine show/hide,
 |         //    Execute the column tests for each row in the autoFilter range to determine show/hide,
 | ||||||
|         for ($row = $rangeStart[1] + 1; $row <= $rangeEnd[1]; ++$row) { |         for ($row = $rangeStart[1] + 1; $row <= $rangeEnd[1]; ++$row) { | ||||||
|             //            echo 'Testing Row = ', $row,PHP_EOL;
 |  | ||||||
|             $result = true; |             $result = true; | ||||||
|             foreach ($columnFilterTests as $columnID => $columnFilterTest) { |             foreach ($columnFilterTests as $columnID => $columnFilterTest) { | ||||||
|                 //                echo 'Testing cell ', $columnID.$row,PHP_EOL;
 |  | ||||||
|                 $cellValue = $this->workSheet->getCell($columnID . $row)->getCalculatedValue(); |                 $cellValue = $this->workSheet->getCell($columnID . $row)->getCalculatedValue(); | ||||||
| //                echo 'Value is ', $cellValue,PHP_EOL;
 |  | ||||||
|                 //    Execute the filter test
 |                 //    Execute the filter test
 | ||||||
|                 $result = $result && |                 $result = $result && | ||||||
|                     call_user_func_array( |                     call_user_func_array( | ||||||
|                         ['\\PhpSpreadsheet\\Worksheet\\AutoFilter', $columnFilterTest['method']], |                         ['\\PhpSpreadsheet\\Worksheet\\AutoFilter', $columnFilterTest['method']], | ||||||
|                         [$cellValue, $columnFilterTest['arguments']] |                         [$cellValue, $columnFilterTest['arguments']] | ||||||
|                     ); |                     ); | ||||||
| //                echo (($result) ? 'VALID' : 'INVALID'),PHP_EOL;
 |  | ||||||
|                 //    If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests
 |                 //    If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests
 | ||||||
|                 if (!$result) { |                 if (!$result) { | ||||||
|                     break; |                     break; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             //    Set show/hide for the row based on the result of the autoFilter result
 |             //    Set show/hide for the row based on the result of the autoFilter result
 | ||||||
| //            echo (($result) ? 'SHOW' : 'HIDE'),PHP_EOL;
 |  | ||||||
|             $this->workSheet->getRowDimension($row)->setVisible($result); |             $this->workSheet->getRowDimension($row)->setVisible($result); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet\AutoFilter; | namespace PhpSpreadsheet\Worksheet\AutoFilter; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\AutoFilter\Column |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet\AutoFilter\Column; | namespace PhpSpreadsheet\Worksheet\AutoFilter\Column; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_BaseDrawing |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_CellIterator |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\Column |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\ColumnCellIterator |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\ColumnDimension |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -6,8 +6,6 @@ use PhpSpreadsheet\Cell; | |||||||
| use PhpSpreadsheet\Exception; | use PhpSpreadsheet\Exception; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\ColumnIterator |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_Dimension |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_Drawing |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet\Drawing; | namespace PhpSpreadsheet\Worksheet\Drawing; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_Drawing_Shadow |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_HeaderFooter |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_HeaderFooterDrawing |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_MemoryDrawing |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\PageMargins |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\PageSetup |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_Protection |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\Row |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\RowCellIterator |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\RowDimension |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet\RowIterator |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Worksheet; | namespace PhpSpreadsheet\Worksheet; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Worksheet_SheetView |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer; | namespace PhpSpreadsheet\Writer; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\BaseWriter |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2016 PhpSpreadsheet |  * Copyright (c) 2006 - 2016 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -310,10 +310,6 @@ class Chart extends WriterPart | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             //    Generate 2 unique numbers to use for axId values
 |             //    Generate 2 unique numbers to use for axId values
 | ||||||
|             //                    $id1 = $id2 = rand(10000000,99999999);
 |  | ||||||
|             //                    do {
 |  | ||||||
|             //                        $id2 = rand(10000000,99999999);
 |  | ||||||
|             //                    } while ($id1 == $id2);
 |  | ||||||
|             $id1 = '75091328'; |             $id1 = '75091328'; | ||||||
|             $id2 = '75089408'; |             $id2 = '75089408'; | ||||||
| 
 | 
 | ||||||
| @ -458,7 +454,6 @@ class Chart extends WriterPart | |||||||
|                 $caption = $caption[0]; |                 $caption = $caption[0]; | ||||||
|             } |             } | ||||||
|             $objWriter->startElement('a:t'); |             $objWriter->startElement('a:t'); | ||||||
|             //                                        $objWriter->writeAttribute('xml:space', 'preserve');
 |  | ||||||
|             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); |             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); | ||||||
|             $objWriter->endElement(); |             $objWriter->endElement(); | ||||||
| 
 | 
 | ||||||
| @ -808,7 +803,6 @@ class Chart extends WriterPart | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             $objWriter->startElement('a:t'); |             $objWriter->startElement('a:t'); | ||||||
|             //                                        $objWriter->writeAttribute('xml:space', 'preserve');
 |  | ||||||
|             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); |             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($caption)); | ||||||
|             $objWriter->endElement(); |             $objWriter->endElement(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -240,9 +240,6 @@ class Comments extends WriterPart | |||||||
|                 // x:SizeWithCells
 |                 // x:SizeWithCells
 | ||||||
|                 $objWriter->writeElement('x:SizeWithCells', ''); |                 $objWriter->writeElement('x:SizeWithCells', ''); | ||||||
| 
 | 
 | ||||||
|                 // x:Anchor
 |  | ||||||
|                 //$objWriter->writeElement('x:Anchor', $column . ', 15, ' . ($row - 2) . ', 10, ' . ($column + 4) . ', 15, ' . ($row + 5) . ', 18');
 |  | ||||||
| 
 |  | ||||||
|                 // x:AutoFill
 |                 // x:AutoFill
 | ||||||
|                 $objWriter->writeElement('x:AutoFill', 'False'); |                 $objWriter->writeElement('x:AutoFill', 'False'); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -242,47 +242,6 @@ class Drawing extends WriterPart | |||||||
| 
 | 
 | ||||||
|             $objWriter->endElement(); |             $objWriter->endElement(); | ||||||
| 
 | 
 | ||||||
| //                        // a:solidFill
 |  | ||||||
| //                        $objWriter->startElement('a:solidFill');
 |  | ||||||
| 
 |  | ||||||
| //                            // a:srgbClr
 |  | ||||||
| //                            $objWriter->startElement('a:srgbClr');
 |  | ||||||
| //                            $objWriter->writeAttribute('val', 'FFFFFF');
 |  | ||||||
| 
 |  | ||||||
| ///* SHADE
 |  | ||||||
| //                                // a:shade
 |  | ||||||
| //                                $objWriter->startElement('a:shade');
 |  | ||||||
| //                                $objWriter->writeAttribute('val', '85000');
 |  | ||||||
| //                                $objWriter->endElement();
 |  | ||||||
| //*/
 |  | ||||||
| 
 |  | ||||||
| //                            $objWriter->endElement();
 |  | ||||||
| 
 |  | ||||||
| //                        $objWriter->endElement();
 |  | ||||||
| /* |  | ||||||
|             // a:ln
 |  | ||||||
|             $objWriter->startElement('a:ln'); |  | ||||||
|             $objWriter->writeAttribute('w', '88900'); |  | ||||||
|             $objWriter->writeAttribute('cap', 'sq'); |  | ||||||
| 
 |  | ||||||
|                 // a:solidFill
 |  | ||||||
|                 $objWriter->startElement('a:solidFill'); |  | ||||||
| 
 |  | ||||||
|                     // a:srgbClr
 |  | ||||||
|                     $objWriter->startElement('a:srgbClr'); |  | ||||||
|                     $objWriter->writeAttribute('val', 'FFFFFF'); |  | ||||||
|                     $objWriter->endElement(); |  | ||||||
| 
 |  | ||||||
|                 $objWriter->endElement(); |  | ||||||
| 
 |  | ||||||
|                 // a:miter
 |  | ||||||
|                 $objWriter->startElement('a:miter'); |  | ||||||
|                 $objWriter->writeAttribute('lim', '800000'); |  | ||||||
|                 $objWriter->endElement(); |  | ||||||
| 
 |  | ||||||
|             $objWriter->endElement(); |  | ||||||
| */ |  | ||||||
| 
 |  | ||||||
|             if ($pDrawing->getShadow()->getVisible()) { |             if ($pDrawing->getShadow()->getVisible()) { | ||||||
|                 // a:effectLst
 |                 // a:effectLst
 | ||||||
|                 $objWriter->startElement('a:effectLst'); |                 $objWriter->startElement('a:effectLst'); | ||||||
|  | |||||||
| @ -221,21 +221,6 @@ class Rels extends WriterPart | |||||||
|             ); |             ); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // Write chart relationships?
 |  | ||||||
| //            $chartCount = 0;
 |  | ||||||
| //            $charts = $pWorksheet->getChartCollection();
 |  | ||||||
| //            echo 'Chart Rels: ' , count($charts) , '<br />';
 |  | ||||||
| //            if (count($charts) > 0) {
 |  | ||||||
| //                foreach ($charts as $chart) {
 |  | ||||||
| //                    $this->writeRelationship(
 |  | ||||||
| //                        $objWriter,
 |  | ||||||
| //                        ++$d,
 |  | ||||||
| //                        'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
 |  | ||||||
| //                        '../charts/chart' . ++$chartCount . '.xml'
 |  | ||||||
| //                    );
 |  | ||||||
| //                }
 |  | ||||||
| //            }
 |  | ||||||
| //
 |  | ||||||
|         // Write hyperlink relationships?
 |         // Write hyperlink relationships?
 | ||||||
|         $i = 1; |         $i = 1; | ||||||
|         foreach ($pWorksheet->getHyperlinkCollection() as $hyperlink) { |         foreach ($pWorksheet->getHyperlinkCollection() as $hyperlink) { | ||||||
|  | |||||||
| @ -264,22 +264,10 @@ class StringTable extends WriterPart | |||||||
|             $objWriter->writeAttribute('typeface', $element->getFont()->getName()); |             $objWriter->writeAttribute('typeface', $element->getFont()->getName()); | ||||||
|             $objWriter->endElement(); |             $objWriter->endElement(); | ||||||
| 
 | 
 | ||||||
|                 // Superscript / subscript
 |  | ||||||
| //                    if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) {
 |  | ||||||
| //                        $objWriter->startElement($prefix.'vertAlign');
 |  | ||||||
| //                        if ($element->getFont()->getSuperScript()) {
 |  | ||||||
| //                            $objWriter->writeAttribute('val', 'superscript');
 |  | ||||||
| //                        } elseif ($element->getFont()->getSubScript()) {
 |  | ||||||
| //                            $objWriter->writeAttribute('val', 'subscript');
 |  | ||||||
| //                        }
 |  | ||||||
| //                        $objWriter->endElement();
 |  | ||||||
| //                    }
 |  | ||||||
| //
 |  | ||||||
|             $objWriter->endElement(); |             $objWriter->endElement(); | ||||||
| 
 | 
 | ||||||
|             // t
 |             // t
 | ||||||
|             $objWriter->startElement($prefix . 't'); |             $objWriter->startElement($prefix . 't'); | ||||||
| //                    $objWriter->writeAttribute('xml:space', 'preserve');    //    Excel2010 accepts, Excel2007 complains
 |  | ||||||
|             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); |             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); | ||||||
|             $objWriter->endElement(); |             $objWriter->endElement(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -145,7 +145,6 @@ class Worksheet extends WriterPart | |||||||
|     { |     { | ||||||
|         // sheetPr
 |         // sheetPr
 | ||||||
|         $objWriter->startElement('sheetPr'); |         $objWriter->startElement('sheetPr'); | ||||||
|         //$objWriter->writeAttribute('codeName',        $pSheet->getTitle());
 |  | ||||||
|         if ($pSheet->getParent()->hasMacros()) { |         if ($pSheet->getParent()->hasMacros()) { | ||||||
|             //if the workbook have macros, we need to have codeName for the sheet
 |             //if the workbook have macros, we need to have codeName for the sheet
 | ||||||
|             if ($pSheet->hasCodeName() == false) { |             if ($pSheet->hasCodeName() == false) { | ||||||
| @ -1125,7 +1124,6 @@ class Worksheet extends WriterPart | |||||||
|                         } |                         } | ||||||
|                         if ($this->getParentWriter()->getOffice2003Compatibility() === false) { |                         if ($this->getParentWriter()->getOffice2003Compatibility() === false) { | ||||||
|                             if ($this->getParentWriter()->getPreCalculateFormulas()) { |                             if ($this->getParentWriter()->getPreCalculateFormulas()) { | ||||||
|                                 //                                $calculatedValue = $pCell->getCalculatedValue();
 |  | ||||||
|                                 if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') { |                                 if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') { | ||||||
|                                     $objWriter->writeElement('v', \PhpSpreadsheet\Shared\StringHelper::formatNumber($calculatedValue)); |                                     $objWriter->writeElement('v', \PhpSpreadsheet\Shared\StringHelper::formatNumber($calculatedValue)); | ||||||
|                                 } else { |                                 } else { | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel2007; | namespace PhpSpreadsheet\Writer\Excel2007; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel2007\WriterPart |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer; | namespace PhpSpreadsheet\Writer; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5 |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel5; | namespace PhpSpreadsheet\Writer\Excel5; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5\BIFFwriter |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -94,7 +92,6 @@ class BIFFwriter | |||||||
|     { |     { | ||||||
|         $this->_data = ''; |         $this->_data = ''; | ||||||
|         $this->_datasize = 0; |         $this->_datasize = 0; | ||||||
| //        $this->limit      = 8224;
 |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel5; | namespace PhpSpreadsheet\Writer\Excel5; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5\Escher |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -292,7 +290,6 @@ class Escher | |||||||
|                 // number of shapes in this drawing (including group shape)
 |                 // number of shapes in this drawing (including group shape)
 | ||||||
|                 $countShapes = count($this->object->getSpgrContainer()->getChildren()); |                 $countShapes = count($this->object->getSpgrContainer()->getChildren()); | ||||||
|                 $innerData .= $header . pack('VV', $countShapes, $this->object->getLastSpId()); |                 $innerData .= $header . pack('VV', $countShapes, $this->object->getLastSpId()); | ||||||
|                 //$innerData .= $header . pack('VV', 0, 0);
 |  | ||||||
| 
 | 
 | ||||||
|                 // write the spgrContainer
 |                 // write the spgrContainer
 | ||||||
|                 if ($spgrContainer = $this->object->getSpgrContainer()) { |                 if ($spgrContainer = $this->object->getSpgrContainer()) { | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel5; | namespace PhpSpreadsheet\Writer\Excel5; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5\Font |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel5; | namespace PhpSpreadsheet\Writer\Excel5; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5\Parser |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -592,7 +590,6 @@ class Parser | |||||||
|     private function convertFunction($token, $num_args) |     private function convertFunction($token, $num_args) | ||||||
|     { |     { | ||||||
|         $args = $this->functions[$token][1]; |         $args = $this->functions[$token][1]; | ||||||
| //        $volatile = $this->functions[$token][3];
 |  | ||||||
| 
 | 
 | ||||||
|         // Fixed number of args eg. TIME($i, $j, $k).
 |         // Fixed number of args eg. TIME($i, $j, $k).
 | ||||||
|         if ($args >= 0) { |         if ($args >= 0) { | ||||||
| @ -650,8 +647,6 @@ class Parser | |||||||
|      */ |      */ | ||||||
|     private function convertRange3d($token) |     private function convertRange3d($token) | ||||||
|     { |     { | ||||||
|         //        $class = 0; // formulas like Sheet1!$A$1:$A$2 in list type data validation need this class (0x3B)
 |  | ||||||
| 
 |  | ||||||
|         // Split the ref at the ! symbol
 |         // Split the ref at the ! symbol
 | ||||||
|         list($ext_ref, $range) = explode('!', $token); |         list($ext_ref, $range) = explode('!', $token); | ||||||
| 
 | 
 | ||||||
| @ -670,15 +665,7 @@ class Parser | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // The ptg value depends on the class of the ptg.
 |         // The ptg value depends on the class of the ptg.
 | ||||||
| //        if ($class == 0) {
 |         $ptgArea = pack('C', $this->ptg['ptgArea3d']); | ||||||
|             $ptgArea = pack('C', $this->ptg['ptgArea3d']); |  | ||||||
| //        } elseif ($class == 1) {
 |  | ||||||
| //            $ptgArea = pack("C", $this->ptg['ptgArea3dV']);
 |  | ||||||
| //        } elseif ($class == 2) {
 |  | ||||||
| //            $ptgArea = pack("C", $this->ptg['ptgArea3dA']);
 |  | ||||||
| //        } else {
 |  | ||||||
| //            throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class");
 |  | ||||||
| //        }
 |  | ||||||
| 
 | 
 | ||||||
|         return $ptgArea . $ext_ref . $row1 . $row2 . $col1 . $col2; |         return $ptgArea . $ext_ref . $row1 . $row2 . $col1 . $col2; | ||||||
|     } |     } | ||||||
| @ -691,23 +678,13 @@ class Parser | |||||||
|      */ |      */ | ||||||
|     private function convertRef2d($cell) |     private function convertRef2d($cell) | ||||||
|     { |     { | ||||||
|         //        $class = 2; // as far as I know, this is magick.
 |  | ||||||
| 
 |  | ||||||
|         // Convert the cell reference
 |         // Convert the cell reference
 | ||||||
|         $cell_array = $this->cellToPackedRowcol($cell); |         $cell_array = $this->cellToPackedRowcol($cell); | ||||||
|         list($row, $col) = $cell_array; |         list($row, $col) = $cell_array; | ||||||
| 
 | 
 | ||||||
|         // The ptg value depends on the class of the ptg.
 |         // The ptg value depends on the class of the ptg.
 | ||||||
| //        if ($class == 0) {
 |         $ptgRef = pack('C', $this->ptg['ptgRefA']); | ||||||
| //            $ptgRef = pack("C", $this->ptg['ptgRef']);
 | 
 | ||||||
| //        } elseif ($class == 1) {
 |  | ||||||
| //            $ptgRef = pack("C", $this->ptg['ptgRefV']);
 |  | ||||||
| //        } elseif ($class == 2) {
 |  | ||||||
|             $ptgRef = pack('C', $this->ptg['ptgRefA']); |  | ||||||
| //        } else {
 |  | ||||||
| //            // TODO: use real error codes
 |  | ||||||
| //            throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class");
 |  | ||||||
| //        }
 |  | ||||||
|         return $ptgRef . $row . $col; |         return $ptgRef . $row . $col; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -720,8 +697,6 @@ class Parser | |||||||
|      */ |      */ | ||||||
|     private function convertRef3d($cell) |     private function convertRef3d($cell) | ||||||
|     { |     { | ||||||
|         //        $class = 2; // as far as I know, this is magick.
 |  | ||||||
| 
 |  | ||||||
|         // Split the ref at the ! symbol
 |         // Split the ref at the ! symbol
 | ||||||
|         list($ext_ref, $cell) = explode('!', $cell); |         list($ext_ref, $cell) = explode('!', $cell); | ||||||
| 
 | 
 | ||||||
| @ -732,15 +707,7 @@ class Parser | |||||||
|         list($row, $col) = $this->cellToPackedRowcol($cell); |         list($row, $col) = $this->cellToPackedRowcol($cell); | ||||||
| 
 | 
 | ||||||
|         // The ptg value depends on the class of the ptg.
 |         // The ptg value depends on the class of the ptg.
 | ||||||
| //        if ($class == 0) {
 |         $ptgRef = pack('C', $this->ptg['ptgRef3dA']); | ||||||
| //            $ptgRef = pack("C", $this->ptg['ptgRef3d']);
 |  | ||||||
| //        } elseif ($class == 1) {
 |  | ||||||
| //            $ptgRef = pack("C", $this->ptg['ptgRef3dV']);
 |  | ||||||
| //        } elseif ($class == 2) {
 |  | ||||||
|             $ptgRef = pack('C', $this->ptg['ptgRef3dA']); |  | ||||||
| //        } else {
 |  | ||||||
| //            throw new \PhpSpreadsheet\Writer\Exception("Unknown class $class");
 |  | ||||||
| //        }
 |  | ||||||
| 
 | 
 | ||||||
|         return $ptgRef . $ext_ref . $row . $col; |         return $ptgRef . $ext_ref . $row . $col; | ||||||
|     } |     } | ||||||
| @ -1034,9 +1001,6 @@ class Parser | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if ($this->match($token) != '') { |             if ($this->match($token) != '') { | ||||||
|                 //if ($i < strlen($this->formula) - 1) {
 |  | ||||||
|                 //    $this->lookAhead = $this->formula{$i+1};
 |  | ||||||
|                 //}
 |  | ||||||
|                 $this->currentCharacter = $i + 1; |                 $this->currentCharacter = $i + 1; | ||||||
|                 $this->currentToken = $token; |                 $this->currentToken = $token; | ||||||
| 
 | 
 | ||||||
| @ -1355,7 +1319,6 @@ class Parser | |||||||
|         } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { |         } elseif (preg_match('/^' . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { | ||||||
|             // If it's an external range (Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2)
 |             // If it's an external range (Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2)
 | ||||||
|             // must be an error?
 |             // must be an error?
 | ||||||
|             //$result = $this->currentToken;
 |  | ||||||
|             $result = $this->createTree($this->currentToken, '', ''); |             $result = $this->createTree($this->currentToken, '', ''); | ||||||
|             $this->advance(); |             $this->advance(); | ||||||
| 
 | 
 | ||||||
| @ -1363,7 +1326,6 @@ class Parser | |||||||
|         } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { |         } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u", $this->currentToken)) { | ||||||
|             // If it's an external range ('Sheet1'!A1:B2 or 'Sheet1'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1'!$A$1:$B$2)
 |             // If it's an external range ('Sheet1'!A1:B2 or 'Sheet1'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1'!$A$1:$B$2)
 | ||||||
|             // must be an error?
 |             // must be an error?
 | ||||||
|             //$result = $this->currentToken;
 |  | ||||||
|             $result = $this->createTree($this->currentToken, '', ''); |             $result = $this->createTree($this->currentToken, '', ''); | ||||||
|             $this->advance(); |             $this->advance(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel5; | namespace PhpSpreadsheet\Writer\Excel5; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5\Workbook |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -210,8 +208,6 @@ class Workbook extends BIFFwriter | |||||||
| 
 | 
 | ||||||
|         $this->spreadsheet = $spreadsheet; |         $this->spreadsheet = $spreadsheet; | ||||||
| 
 | 
 | ||||||
|         // set BIFFwriter limit for CONTINUE records
 |  | ||||||
|         //        $this->_limit = 8224;
 |  | ||||||
|         $this->codepage = 0x04B0; |         $this->codepage = 0x04B0; | ||||||
| 
 | 
 | ||||||
|         // Add empty sheets and Build color cache
 |         // Add empty sheets and Build color cache
 | ||||||
| @ -1228,7 +1224,7 @@ class Workbook extends BIFFwriter | |||||||
|         $header = pack('vv', $record, $length); |         $header = pack('vv', $record, $length); | ||||||
|         /* using the same country code always for simplicity */ |         /* using the same country code always for simplicity */ | ||||||
|         $data = pack('vv', $this->countryCode, $this->countryCode); |         $data = pack('vv', $this->countryCode, $this->countryCode); | ||||||
|         //$this->append($header . $data);
 | 
 | ||||||
|         return $this->writeData($header . $data); |         return $this->writeData($header . $data); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel5; | namespace PhpSpreadsheet\Writer\Excel5; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5\Worksheet |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
| @ -209,9 +207,6 @@ class Worksheet extends BIFFwriter | |||||||
|         // It needs to call its parent's constructor explicitly
 |         // It needs to call its parent's constructor explicitly
 | ||||||
|         parent::__construct(); |         parent::__construct(); | ||||||
| 
 | 
 | ||||||
|         // change BIFFwriter limit for CONTINUE records
 |  | ||||||
| //        $this->_limit = 8224;
 |  | ||||||
| 
 |  | ||||||
|         $this->_preCalculateFormulas = $preCalculateFormulas; |         $this->_preCalculateFormulas = $preCalculateFormulas; | ||||||
|         $this->stringTotal = &$str_total; |         $this->stringTotal = &$str_total; | ||||||
|         $this->stringUnique = &$str_unique; |         $this->stringUnique = &$str_unique; | ||||||
| @ -221,8 +216,6 @@ class Worksheet extends BIFFwriter | |||||||
| 
 | 
 | ||||||
|         $this->phpSheet = $phpSheet; |         $this->phpSheet = $phpSheet; | ||||||
| 
 | 
 | ||||||
|         //$this->ext_sheets        = array();
 |  | ||||||
|         //$this->offset            = 0;
 |  | ||||||
|         $this->xlsStringMaxLength = 255; |         $this->xlsStringMaxLength = 255; | ||||||
|         $this->columnInfo = []; |         $this->columnInfo = []; | ||||||
|         $this->selection = [0, 0, 0, 0]; |         $this->selection = [0, 0, 0, 0]; | ||||||
| @ -245,7 +238,6 @@ class Worksheet extends BIFFwriter | |||||||
|         $maxC = $this->phpSheet->getHighestColumn(); |         $maxC = $this->phpSheet->getHighestColumn(); | ||||||
| 
 | 
 | ||||||
|         // Determine lowest and highest column and row
 |         // Determine lowest and highest column and row
 | ||||||
| //        $this->firstRowIndex = ($minR > 65535) ? 65535 : $minR;
 |  | ||||||
|         $this->lastRowIndex = ($maxR > 65535) ? 65535 : $maxR; |         $this->lastRowIndex = ($maxR > 65535) ? 65535 : $maxR; | ||||||
| 
 | 
 | ||||||
|         $this->firstColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($minC); |         $this->firstColumnIndex = \PhpSpreadsheet\Cell::columnIndexFromString($minC); | ||||||
| @ -398,7 +390,6 @@ class Worksheet extends BIFFwriter | |||||||
| 
 | 
 | ||||||
|             $cVal = $cell->getValue(); |             $cVal = $cell->getValue(); | ||||||
|             if ($cVal instanceof \PhpSpreadsheet\RichText) { |             if ($cVal instanceof \PhpSpreadsheet\RichText) { | ||||||
|                 // $this->writeString($row, $column, $cVal->getPlainText(), $xfIndex);
 |  | ||||||
|                 $arrcRun = []; |                 $arrcRun = []; | ||||||
|                 $str_len = \PhpSpreadsheet\Shared\StringHelper::countCharacters($cVal->getPlainText(), 'UTF-8'); |                 $str_len = \PhpSpreadsheet\Shared\StringHelper::countCharacters($cVal->getPlainText(), 'UTF-8'); | ||||||
|                 $str_pos = 0; |                 $str_pos = 0; | ||||||
| @ -479,7 +470,6 @@ class Worksheet extends BIFFwriter | |||||||
|                 $url = str_replace('sheet://', 'internal:', $url); |                 $url = str_replace('sheet://', 'internal:', $url); | ||||||
|             } elseif (preg_match('/^(http:|https:|ftp:|mailto:)/', $url)) { |             } elseif (preg_match('/^(http:|https:|ftp:|mailto:)/', $url)) { | ||||||
|                 // URL
 |                 // URL
 | ||||||
|                 // $url = $url;
 |  | ||||||
|             } else { |             } else { | ||||||
|                 // external (local file)
 |                 // external (local file)
 | ||||||
|                 $url = 'external:' . $url; |                 $url = 'external:' . $url; | ||||||
| @ -2305,7 +2295,7 @@ class Worksheet extends BIFFwriter | |||||||
|     public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) |     public function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) | ||||||
|     { |     { | ||||||
|         $bitmap_array = (is_resource($bitmap) ? $this->processBitmapGd($bitmap) : $this->processBitmap($bitmap)); |         $bitmap_array = (is_resource($bitmap) ? $this->processBitmapGd($bitmap) : $this->processBitmap($bitmap)); | ||||||
|         list($width, $height, $size, $data) = $bitmap_array; //$this->processBitmap($bitmap);
 |         list($width, $height, $size, $data) = $bitmap_array; | ||||||
| 
 | 
 | ||||||
|         // Scale the frame of the image.
 |         // Scale the frame of the image.
 | ||||||
|         $width *= $scale_x; |         $width *= $scale_x; | ||||||
| @ -2606,7 +2596,6 @@ class Worksheet extends BIFFwriter | |||||||
|         $compression = unpack('Vcomp', substr($data, 0, 4)); |         $compression = unpack('Vcomp', substr($data, 0, 4)); | ||||||
|         $data = substr($data, 4); |         $data = substr($data, 4); | ||||||
| 
 | 
 | ||||||
|         //$compression = 0;
 |  | ||||||
|         if ($compression['comp'] != 0) { |         if ($compression['comp'] != 0) { | ||||||
|             throw new \PhpSpreadsheet\Writer\Exception("$bitmap: compression not supported in bitmap image.\n"); |             throw new \PhpSpreadsheet\Writer\Exception("$bitmap: compression not supported in bitmap image.\n"); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer\Excel5; | namespace PhpSpreadsheet\Writer\Excel5; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Excel5\Xf |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -3,8 +3,6 @@ | |||||||
| namespace PhpSpreadsheet\Writer; | namespace PhpSpreadsheet\Writer; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * \PhpSpreadsheet\Writer\Exception |  | ||||||
|  * |  | ||||||
|  * Copyright (c) 2006 - 2015 PhpSpreadsheet |  * Copyright (c) 2006 - 2015 PhpSpreadsheet | ||||||
|  * |  * | ||||||
|  * This library is free software; you can redistribute it and/or |  * This library is free software; you can redistribute it and/or | ||||||
|  | |||||||
| @ -1035,8 +1035,6 @@ class HTML extends BaseWriter implements IWriter | |||||||
|      */ |      */ | ||||||
|     private function createCSSStyleBorder(\Spreadsheet\Style\Border $pStyle) |     private function createCSSStyleBorder(\Spreadsheet\Style\Border $pStyle) | ||||||
|     { |     { | ||||||
|         // Create CSS
 |  | ||||||
| //        $css = $this->mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
 |  | ||||||
|         //    Create CSS - add !important to non-none border styles for merged cells
 |         //    Create CSS - add !important to non-none border styles for merged cells
 | ||||||
|         $borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle()); |         $borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle()); | ||||||
|         $css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important'); |         $css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important'); | ||||||
|  | |||||||
| @ -43,19 +43,12 @@ class Comment | |||||||
|         $comment = $comments[$cell->getCoordinate()]; |         $comment = $comments[$cell->getCoordinate()]; | ||||||
| 
 | 
 | ||||||
|         $objWriter->startElement('office:annotation'); |         $objWriter->startElement('office:annotation'); | ||||||
|             //$objWriter->writeAttribute('draw:style-name', 'gr1');
 |         $objWriter->writeAttribute('svg:width', $comment->getWidth()); | ||||||
|             //$objWriter->writeAttribute('draw:text-style-name', 'P1');
 |  | ||||||
|             $objWriter->writeAttribute('svg:width', $comment->getWidth()); |  | ||||||
|         $objWriter->writeAttribute('svg:height', $comment->getHeight()); |         $objWriter->writeAttribute('svg:height', $comment->getHeight()); | ||||||
|         $objWriter->writeAttribute('svg:x', $comment->getMarginLeft()); |         $objWriter->writeAttribute('svg:x', $comment->getMarginLeft()); | ||||||
|         $objWriter->writeAttribute('svg:y', $comment->getMarginTop()); |         $objWriter->writeAttribute('svg:y', $comment->getMarginTop()); | ||||||
|             //$objWriter->writeAttribute('draw:caption-point-x', $comment->getMarginLeft());
 |         $objWriter->writeElement('dc:creator', $comment->getAuthor()); | ||||||
|             //$objWriter->writeAttribute('draw:caption-point-y', $comment->getMarginTop());
 |         $objWriter->writeElement('text:p', $comment->getText()->getPlainText()); | ||||||
|                 $objWriter->writeElement('dc:creator', $comment->getAuthor()); |  | ||||||
|                 // TODO: Not realized in \PhpSpreadsheet\Comment yet.
 |  | ||||||
|                 //$objWriter->writeElement('dc:date', $comment->getDate());
 |  | ||||||
|                 $objWriter->writeElement('text:p', $comment->getText()->getPlainText()); |  | ||||||
|                     //$objWriter->writeAttribute('draw:text-style-name', 'P1');
 |  | ||||||
|         $objWriter->endElement(); |         $objWriter->endElement(); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -123,7 +123,6 @@ class Content extends WriterPart | |||||||
| 
 | 
 | ||||||
|         $sheet_count = $spreadsheet->getSheetCount(); |         $sheet_count = $spreadsheet->getSheetCount(); | ||||||
|         for ($i = 0; $i < $sheet_count; ++$i) { |         for ($i = 0; $i < $sheet_count; ++$i) { | ||||||
|             //$this->getWriterPart('Worksheet')->writeWorksheet());
 |  | ||||||
|             $objWriter->startElement('table:table'); |             $objWriter->startElement('table:table'); | ||||||
|             $objWriter->writeAttribute('table:name', $spreadsheet->getSheet($i)->getTitle()); |             $objWriter->writeAttribute('table:name', $spreadsheet->getSheet($i)->getTitle()); | ||||||
|             $objWriter->writeElement('office:forms'); |             $objWriter->writeElement('office:forms'); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Adrien Crivelli
						Adrien Crivelli