Skip inner loops for empty/default read filter (#2223)

The optimization from #773 was not copied along in #1033, so restore it

Co-authored-by: Adrien Crivelli <adrien.crivelli@gmail.com>
This commit is contained in:
Richard van Velzen 2021-10-30 17:09:02 +02:00 committed by GitHub
parent e550528c02
commit 5b4b12f77b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -144,6 +144,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
- Column width and Row height styles in the Html Reader when the value includes a unit of measure. [Issue #2145](https://github.com/PHPOffice/PhpSpreadsheet/issues/2145).
- Data Validation flags not set correctly when reading XLSX files. [Issue #2224](https://github.com/PHPOffice/PhpSpreadsheet/issues/2224) [PR #2225](https://github.com/PHPOffice/PhpSpreadsheet/pull/2225)
- Reading XLSX files without styles.xml throws an exception. [Issue #2246](https://github.com/PHPOffice/PhpSpreadsheet/issues/2246)
- Improve XLSX parsing speed if no readFilter is applied (again) - [#772](https://github.com/PHPOffice/PhpSpreadsheet/issues/772)
## 1.18.0 - 2021-05-31

View File

@ -3,6 +3,7 @@
namespace PhpOffice\PhpSpreadsheet\Reader\Xlsx;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter;
use PhpOffice\PhpSpreadsheet\Reader\IReadFilter;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use SimpleXMLElement;
@ -91,6 +92,10 @@ class ColumnAndRowAttributes extends BaseParserClass
$rowsAttributes = $this->readRowAttributes($this->worksheetXml->sheetData->row, $readDataOnly);
}
if ($readFilter !== null && get_class($readFilter) === DefaultReadFilter::class) {
$readFilter = null;
}
// set columns/rows attributes
$columnsAttributesAreSet = [];
foreach ($columnsAttributes as $columnCoordinate => $columnAttributes) {