diff --git a/CHANGELOG.md b/CHANGELOG.md index 46d3b394..74d75470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Added - Refactored Matrix Functions to use external Matrix library -- Possibility to specify custom colors of values for pie and donut charts (https://github.com/PHPOffice/PhpSpreadsheet/pull/768) +- Possibility to specify custom colors of values for pie and donut charts - [#768](https://github.com/PHPOffice/PhpSpreadsheet/pull/768) ### Fixed - Improve XLSX parsing speed if no readFilter is applied - [#772](https://github.com/PHPOffice/PhpSpreadsheet/issues/772) +- Fix column names if read filter calls in XLSX reader skip columns - [#777](https://github.com/PHPOffice/PhpSpreadsheet/pull/777) ## [1.5.2] - 2018-11-25 @@ -40,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix print area parser for XLSX reader - [#734](https://github.com/PHPOffice/PhpSpreadsheet/pull/734) - Support overriding `DefaultValueBinder::dataTypeForValue()` without overriding `DefaultValueBinder::bindValue()` - [#735](https://github.com/PHPOffice/PhpSpreadsheet/pull/735) - Mpdf export can exceed pcre.backtrack_limit - [#637](https://github.com/PHPOffice/PhpSpreadsheet/issues/637) +- Fix index overflow on data values array - [#748](https://github.com/PHPOffice/PhpSpreadsheet/pull/748) ## [1.5.0] - 2018-10-21 diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 52ac4705..335f5d7e 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -911,6 +911,8 @@ class Xlsx extends BaseReader $coordinates = Coordinate::coordinateFromString($r); if (!$this->getReadFilter()->readCell($coordinates[0], (int) $coordinates[1], $docSheet->getTitle())) { + $rowIndex += 1; + continue; } } diff --git a/tests/PhpSpreadsheetTests/Reader/OddColumnReadFilter.php b/tests/PhpSpreadsheetTests/Reader/OddColumnReadFilter.php new file mode 100644 index 00000000..b9373314 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Reader/OddColumnReadFilter.php @@ -0,0 +1,16 @@ +load($filename); } + + /** + * Test load Xlsx file and use a read filter. + */ + public function testLoadWithReadFilter() + { + $filename = './data/Reader/XLSX/without_cell_reference.xlsx'; + $reader = new Xlsx(); + $reader->setReadFilter(new OddColumnReadFilter()); + $data = $reader->load($filename)->getActiveSheet()->toArray(); + $ref = [1.0, null, 3.0, null, 5.0, null, 7.0, null, 9.0, null]; + + for ($i = 0; $i < 10; ++$i) { + $this->assertEquals($ref, \array_slice($data[$i], 0, 10, true)); + } + } }