From ee74ef92548bf4a7da4cbeaae7e988e76f29fd51 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 1 Sep 2010 12:10:59 +0000 Subject: [PATCH] Workitem 7895 - Excel5 : Formula : Percent git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@60223 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Writer/Excel5/Parser.php | 14 +++++++++++--- changelog.txt | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Classes/PHPExcel/Writer/Excel5/Parser.php b/Classes/PHPExcel/Writer/Excel5/Parser.php index 08d09b49..981f8e60 100644 --- a/Classes/PHPExcel/Writer/Excel5/Parser.php +++ b/Classes/PHPExcel/Writer/Excel5/Parser.php @@ -1179,6 +1179,9 @@ class PHPExcel_Writer_Excel5_Parser case "&": return $token; break; + case "%": + return $token; + break; default: // if it's a reference A1 or $A$1 or $A1 or A$1 if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$token) and @@ -1476,11 +1479,16 @@ class PHPExcel_Writer_Excel5_Parser $this->_advance(); return $result; } + // If it's a number or a percent elseif (is_numeric($this->_current_token)) { - $result = $this->_createTree($this->_current_token, '', ''); - $this->_advance(); - return $result; + if($this->_lookahead == '%'){ + $result = $this->_createTree('ptgPercent', $this->_current_token, ''); + } else { + $result = $this->_createTree($this->_current_token, '', ''); + } + $this->_advance(); + return $result; } // if it's a function call elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$this->_current_token)) diff --git a/changelog.txt b/changelog.txt index 941e2bbd..3da0031a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -24,8 +24,11 @@ Fixed in SVN: +- Bugfix: (Progi1984) Workitem 7895 - Excel5 : Formula : Percent - Feature: (MBaker) Support for Extended Workbook Properties in Excel2007, Excel5 and OOCalc Readers; support for User-defined Workbook Properties in Excel2007 and OOCalc Readers - Bugfix: (MB) Work item 14143 - NA() doesn't propagate in matrix calc - quick fix in JAMA/Matrix.php +- Bugfix: (Progi1984) Workitem 7895 - Excel5 : Formula : Error constant +- Bugfix: (Progi1984) Workitem 7895 - Excel5 : Formula : Concatenation operator 2010-08-26 (v1.7.4): - Bugfix: (Progi1984) Workitem 7895 - Excel5 : Formula : Power