From 77cc77209bf2b56b844629a57ac33b038fe4f8c9 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 26 May 2015 15:50:44 +0100 Subject: [PATCH] Minor performance tweak to OfficeOpenXML and BIFF Readers --- Classes/PHPExcel/Reader/Excel2007.php | 6 ++---- Classes/PHPExcel/Reader/Excel5.php | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 82b0021..c439bfc 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -951,8 +951,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE } // Extract all cell references in $ref - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($ref); - foreach ($aReferences as $reference) { + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($ref) as $reference) { $docSheet->getStyle($reference)->setConditionalStyles($conditionalStyles); } } @@ -1178,8 +1177,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE $stRange = $docSheet->shrinkRangeToFit($range); // Extract all cell references in $range - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($stRange); - foreach ($aReferences as $reference) { + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $reference) { // Create validation $docValidation = $docSheet->getCell($reference)->getDataValidation(); $docValidation->setType((string) $dataValidation["type"]); diff --git a/Classes/PHPExcel/Reader/Excel5.php b/Classes/PHPExcel/Reader/Excel5.php index 498e985..ec22fe5 100644 --- a/Classes/PHPExcel/Reader/Excel5.php +++ b/Classes/PHPExcel/Reader/Excel5.php @@ -4883,8 +4883,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce foreach ($cellRangeAddresses as $cellRange) { $stRange = $this->phpSheet->shrinkRangeToFit($cellRange); - $stRange = PHPExcel_Cell::extractAllCellReferencesInRange($stRange); - foreach ($stRange as $coordinate) { + foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $coordinate) { $objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation(); $objValidation->setType($type); $objValidation->setErrorStyle($errorStyle);