From 29746bb995c85b4fadd1c9346bfdff150e03390d Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Sun, 18 Aug 2013 12:32:40 +0100 Subject: [PATCH] General: (cdhutch) Work item 20055 - remove array_shift in ReferenceHelper::insertNewBefore improves column or row delete speed --- Classes/PHPExcel/ReferenceHelper.php | 6 +++++- changelog.txt | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/ReferenceHelper.php b/Classes/PHPExcel/ReferenceHelper.php index f6fb72fb..f7d13709 100644 --- a/Classes/PHPExcel/ReferenceHelper.php +++ b/Classes/PHPExcel/ReferenceHelper.php @@ -424,7 +424,11 @@ class PHPExcel_ReferenceHelper } // Loop through cells, bottom-up, and change cell coordinates - while (($cellID = $remove ? array_shift($aCellCollection) : array_pop($aCellCollection))) { + if($remove) { + // It's faster to reverse and pop than to use unshift, especially with large cell collections + $aCellCollection = array_reverse($aCellCollection); + } + while ($cellID = array_pop($aCellCollection)) { $cell = $pSheet->getCell($cellID); $cellIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn()); if ($cellIndex-1 + $pNumCols < 0) { diff --git a/changelog.txt b/changelog.txt index 7ff71fb0..ab962b4a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -23,13 +23,16 @@ ************************************************************************************** -Fixed in develop branch for release v1.7.9a: +Fixed in develop branch for release v1.8.0: - Bugfix: (MBaker) Work item 19830 - Undefined variable: fileHandle in CSV Reader +- Bugfix: (MBaker) Work item 19968 - Out of memory in style/supervisor.php - Bugfix: (MBaker) - Style error with merged cells in PDF Writer - Bugfix: (MBaker) - Problem with cloning worksheets - Feature: (amerov) - Implementation of the Excel HLOOKUP() function - Feature: (MBaker) - Added "Quote Prefix" to style settings (Excel2007 Reader and Writer only) - Feature: (MBaker) - Added Horizontal FILL alignment for Excel5 and Excel2007 Readers/Writers, and Horizontal DISTRIBUTED alignment for Excel2007 Reader/Writer +- General: (cdhutch) Work item 20055 - remove array_shift in ReferenceHelper::insertNewBefore improves column or row delete speed + Fixed in develop branch for release v1.7.9: - Feature: (MBaker) Include charts option for HTML Writer