From ad3d9dc8531fc8e1f7a361a2042bcca108d43752 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 15 Dec 2010 10:07:21 +0000 Subject: [PATCH] Bugfix: Work item 14888 - Simple =IF() formula disappears git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@65353 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Writer/Excel5/Parser.php | 5 ++++- changelog.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Writer/Excel5/Parser.php b/Classes/PHPExcel/Writer/Excel5/Parser.php index 0300c5d..25bb1a5 100644 --- a/Classes/PHPExcel/Writer/Excel5/Parser.php +++ b/Classes/PHPExcel/Writer/Excel5/Parser.php @@ -1296,7 +1296,9 @@ class PHPExcel_Writer_Excel5_Parser { // If it's a string return a string node if (preg_match("/\"([^\"]|\"\"){0,255}\"/", $this->_current_token)) { - $result = $this->_createTree(str_replace('""', '"', $this->_current_token), '', ''); + $tmp = str_replace('""', '"', $this->_current_token); + if (($tmp == '"') || ($tmp == '')) $tmp = '""'; // Trap for "" that has been used for an empty string + $result = $this->_createTree($tmp, '', ''); $this->_advance(); return $result; // If it's an error code @@ -1568,6 +1570,7 @@ class PHPExcel_Writer_Excel5_Parser if (empty($tree)) { // If it's the first call use _parse_tree $tree = $this->_parse_tree; } + if (is_array($tree['left'])) { $converted_tree = $this->toReversePolish($tree['left']); $polish .= $converted_tree; diff --git a/changelog.txt b/changelog.txt index 6a6f1f8..e3e875e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -26,6 +26,7 @@ Fixed in SVN: - Feature: (MBaker) Provide option to use PCLZip as an alternative to ZipArchive. This allows the writing of Excel2007 files, even without ZipArchive enabled (it does require zlib), or when php_zip is one of the buggy PHP 5.2.6 or 5.2.8 versions +- Bugfix: (MBaker) Work item 14888 - Simple =IF() formula disappears 2010-12-10 (v1.7.5):