Minor performance tweak to OfficeOpenXML and BIFF Readers

This commit is contained in:
MarkBaker 2015-05-26 15:50:44 +01:00
parent 891478f6ab
commit 77cc77209b
2 changed files with 3 additions and 6 deletions

View File

@ -951,8 +951,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
} }
// Extract all cell references in $ref // Extract all cell references in $ref
$aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($ref); foreach (PHPExcel_Cell::extractAllCellReferencesInRange($ref) as $reference) {
foreach ($aReferences as $reference) {
$docSheet->getStyle($reference)->setConditionalStyles($conditionalStyles); $docSheet->getStyle($reference)->setConditionalStyles($conditionalStyles);
} }
} }
@ -1178,8 +1177,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
$stRange = $docSheet->shrinkRangeToFit($range); $stRange = $docSheet->shrinkRangeToFit($range);
// Extract all cell references in $range // Extract all cell references in $range
$aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($stRange); foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $reference) {
foreach ($aReferences as $reference) {
// Create validation // Create validation
$docValidation = $docSheet->getCell($reference)->getDataValidation(); $docValidation = $docSheet->getCell($reference)->getDataValidation();
$docValidation->setType((string) $dataValidation["type"]); $docValidation->setType((string) $dataValidation["type"]);

View File

@ -4883,8 +4883,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
foreach ($cellRangeAddresses as $cellRange) { foreach ($cellRangeAddresses as $cellRange) {
$stRange = $this->phpSheet->shrinkRangeToFit($cellRange); $stRange = $this->phpSheet->shrinkRangeToFit($cellRange);
$stRange = PHPExcel_Cell::extractAllCellReferencesInRange($stRange); foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $coordinate) {
foreach ($stRange as $coordinate) {
$objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation(); $objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation();
$objValidation->setType($type); $objValidation->setType($type);
$objValidation->setErrorStyle($errorStyle); $objValidation->setErrorStyle($errorStyle);