Fix warning when reading xlsx without styles

Fixes https://github.com/PHPOffice/PHPExcel/issues/1134
Fixes #631
This commit is contained in:
AegirLeet 2018-08-19 08:43:54 +02:00 committed by Adrien Crivelli
parent 62f4b7c8cf
commit bebfb1e41a
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed ### Fixed
- Allow iterators to go out of bounds with prev - [#587](https://github.com/PHPOffice/PhpSpreadsheet/issues/587) - Allow iterators to go out of bounds with prev - [#587](https://github.com/PHPOffice/PhpSpreadsheet/issues/587)
- Fix warning when reading xlsx without styles - [#631](https://github.com/PHPOffice/PhpSpreadsheet/pull/631)
## [1.4.0] - 2018-08-06 ## [1.4.0] - 2018-08-06

View File

@ -643,7 +643,7 @@ class Xlsx extends BaseReader
$excel->addCellXf($objStyle); $excel->addCellXf($objStyle);
} }
foreach ($xmlStyles->cellStyleXfs->xf as $xf) { foreach (isset($xmlStyles->cellStyleXfs->xf) ? $xmlStyles->cellStyleXfs->xf : [] as $xf) {
$numFmt = NumberFormat::FORMAT_GENERAL; $numFmt = NumberFormat::FORMAT_GENERAL;
if ($numFmts && $xf['numFmtId']) { if ($numFmts && $xf['numFmtId']) {
$tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));