Skip to content

Commit 16e5573

Browse files
committed
Small Optimization
1 parent 60ca6c7 commit 16e5573

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PhpSpreadsheet/Reader/Xlsx.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,16 +947,16 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet
947947

948948
// Style information?
949949
if (!$this->readDataOnly) {
950-
$holdSelected = $docSheet->getSelectedCells();
951950
$cAttrS = (int) ($cAttr['s'] ?? 0);
952951
// no style index means 0, it seems
953952
$cAttrS = isset($styles[$cAttrS]) ? $cAttrS : 0;
954953
$cell->setXfIndex($cAttrS);
955954
// issue 3495
956955
if ($cellDataType === DataType::TYPE_FORMULA && $styles[$cAttrS]->quotePrefix === true) {
956+
$holdSelected = $docSheet->getSelectedCells();
957957
$cell->getStyle()->setQuotePrefix(false);
958+
$docSheet->setSelectedCells($holdSelected);
958959
}
959-
$docSheet->setSelectedCells($holdSelected);
960960
}
961961
}
962962
++$rowIndex;

0 commit comments

Comments
 (0)