Skip to content

Commit

Permalink
Minor performance tweak to OfficeOpenXML and BIFF Readers
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBaker committed May 26, 2015
1 parent 891478f commit 77cc772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions Classes/PHPExcel/Reader/Excel2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,7 @@ public function load($pFilename)
}

// 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);
}
}
Expand Down Expand Up @@ -1178,8 +1177,7 @@ public function load($pFilename)
$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"]);
Expand Down
3 changes: 1 addition & 2 deletions Classes/PHPExcel/Reader/Excel5.php
Original file line number Diff line number Diff line change
Expand Up @@ -4883,8 +4883,7 @@ private function readDataValidation()

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);
Expand Down

0 comments on commit 77cc772

Please sign in to comment.