From 907ad1ef6660c656bce7871d4e41e9e55b746036 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sun, 13 Jan 2013 23:36:04 +0000 Subject: [PATCH] Modify listWorksheetNames() and listWorksheetInfo to use XMLReader with streamed XML rather than SimpleXML --- Classes/PHPExcel/Reader/Excel2007.php | 3 ++- Classes/PHPExcel/Reader/OOCalc.php | 4 +++- changelog.txt | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 437f89b..a9c26fe 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -209,7 +209,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE $currCells = 0; while ($xml->read()) { if ($xml->name == 'row' && $xml->nodeType == XMLReader::ELEMENT) { - $tmpInfo['totalRows']++; + $row = $xml->getAttribute('r'); + $tmpInfo['totalRows'] = $row; $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'],$currCells); $currCells = 0; } elseif ($xml->name == 'c' && $xml->nodeType == XMLReader::ELEMENT) { diff --git a/Classes/PHPExcel/Reader/OOCalc.php b/Classes/PHPExcel/Reader/OOCalc.php index 3798aa5..a25ceb0 100644 --- a/Classes/PHPExcel/Reader/OOCalc.php +++ b/Classes/PHPExcel/Reader/OOCalc.php @@ -213,7 +213,9 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce do { $xml->read(); if ($xml->name == 'table:table-row' && $xml->nodeType == XMLReader::ELEMENT) { - $tmpInfo['totalRows']++; + $rowspan = $xml->getAttribute('table:number-rows-repeated'); + $rowspan = empty($rowspan) ? 1 : $rowspan; + $tmpInfo['totalRows'] += $rowspan; $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'],$currCells); $currCells = 0; // Step into the row diff --git a/changelog.txt b/changelog.txt index 4d4668b..bb892fd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -38,6 +38,7 @@ Fixed in develop branch: - General: (amironov ) Work item GH-84 - Search style by identity in PHPExcel_Worksheet::duplicateStyle() - General: (karak) Work item GH-85 - Fill SheetView IO in Excel5 - General: (cfhay) Work item 18958 - Memory and Speed improvements in PHPExcel_Reader_Excel5 +- General: (MBaker) Modify listWorksheetNames() and listWorksheetInfo to use XMLReader with streamed XML rather than SimpleXML - Bugfix: (techhead) Work item GH-70 - Fixed formula/formatting bug when removing rows - Bugfix: (alexgann) Work item GH-63 - Fix to cellExists for non-existent namedRanges - Bugfix: (MBaker) Work item 18844 - cache_in_memory_gzip "eats" last worksheet line, cache_in_memory doesn't