From 1ba2ae0cec68de85f6fd80ddf785db0b423b92cd Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 24 May 2015 12:27:36 +0100 Subject: [PATCH 1/3] Bugfix: (ncrypthic) Work Item GH-570 - Ignore inlineStr type if formula element exists --- Classes/PHPExcel/Calculation/LookupRef.php | 2 +- Classes/PHPExcel/Reader/Excel2007.php | 10 +++++++--- changelog.txt | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Classes/PHPExcel/Calculation/LookupRef.php b/Classes/PHPExcel/Calculation/LookupRef.php index 640f0c2e..af38ea36 100644 --- a/Classes/PHPExcel/Calculation/LookupRef.php +++ b/Classes/PHPExcel/Calculation/LookupRef.php @@ -694,7 +694,7 @@ class PHPExcel_Calculation_LookupRef { $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); $index_number = PHPExcel_Calculation_Functions::flattenSingleValue($index_number); - $not_exact_match = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match); + $not_exact_match = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match); // index_number must be greater than or equal to 1 if ($index_number < 1) { diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 2903313e..82b00213 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -848,8 +848,12 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE } break; case "inlineStr": - // echo 'Inline String', PHP_EOL; - $value = $this->parseRichText($c->is); +// echo 'Inline String', PHP_EOL; + if (isset($c->f)) { + $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError'); + } else { + $value = $this->parseRichText($c->is); + } break; case "e": // echo 'Error', PHP_EOL; @@ -862,7 +866,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE } break; default: - // echo 'Default', PHP_EOL; +// echo 'Default', PHP_EOL; if (!isset($c->f)) { // echo 'Not a Formula', PHP_EOL; $value = self::castToString($c); diff --git a/changelog.txt b/changelog.txt index d12660c2..d4afc0c0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -25,6 +25,7 @@ Planned for 1.8.2 - Bugfix: (MBaker) - Fix to getCell() method when cell reference includes a worksheet reference +- Bugfix: (ncrypthic) Work Item GH-570 - Ignore inlineStr type if formula element exists 2015-04-30 (v1.8.1): From e4d29824a65472298de40c9ab6c82ceb945e471e Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 24 May 2015 12:32:24 +0100 Subject: [PATCH 2/3] General: (umpirsky) Work Item GH-548 - Optimize vlookup() sort --- Classes/PHPExcel/Calculation/LookupRef.php | 4 ++-- changelog.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Calculation/LookupRef.php b/Classes/PHPExcel/Calculation/LookupRef.php index af38ea36..d8605512 100644 --- a/Classes/PHPExcel/Calculation/LookupRef.php +++ b/Classes/PHPExcel/Calculation/LookupRef.php @@ -674,10 +674,10 @@ class PHPExcel_Calculation_LookupRef { reset($a); $firstColumn = key($a); - if (strtolower($a[$firstColumn]) == strtolower($b[$firstColumn])) { + if (($aLower = strtolower($a[$firstColumn])) == ($bLower = strtolower($b[$firstColumn]))) { return 0; } - return (strtolower($a[$firstColumn]) < strtolower($b[$firstColumn])) ? -1 : 1; + return ($aLower < $bLower) ? -1 : 1; } diff --git a/changelog.txt b/changelog.txt index d4afc0c0..2f455c2d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -26,6 +26,7 @@ Planned for 1.8.2 - Bugfix: (MBaker) - Fix to getCell() method when cell reference includes a worksheet reference - Bugfix: (ncrypthic) Work Item GH-570 - Ignore inlineStr type if formula element exists +- General: (umpirsky) Work Item GH-548 - Optimize vlookup() sort 2015-04-30 (v1.8.1): From 5f73ef34d355680280f1f8219b8e883ab94c92f7 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 24 May 2015 12:43:08 +0100 Subject: [PATCH 3/3] Docblock fixes from long to integer --- Classes/PHPExcel/Shared/Date.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index f860b8a4..00aefab3 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -106,11 +106,11 @@ class PHPExcel_Shared_Date /** * Convert a date from Excel to PHP * - * @param long $dateValue Excel date/time value + * @param integer $dateValue Excel date/time value * @param boolean $adjustToTimezone Flag indicating whether $dateValue should be treated as * a UST timestamp, or adjusted to UST * @param string $timezone The timezone for finding the adjustment from UST - * @return long PHP serialized date/time + * @return integer PHP serialized date/time */ public static function ExcelToPHP($dateValue = 0, $adjustToTimezone = false, $timezone = null) { @@ -197,13 +197,13 @@ class PHPExcel_Shared_Date /** * FormattedPHPToExcel * - * @param long $year - * @param long $month - * @param long $day - * @param long $hours - * @param long $minutes - * @param long $seconds - * @return long Excel date/time value + * @param integer $year + * @param integer $month + * @param integer $day + * @param integer $hours + * @param integer $minutes + * @param integer $seconds + * @return integer Excel date/time value */ public static function FormattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) {