From 92389c78ebe60936e230f6c4efd6aab7947adbbe Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 12 Oct 2020 13:22:32 +0200 Subject: [PATCH] Ensure that the list of shared formulae is maintained while chunk-reading Xlsx Files (#1680) * Ensure that the list of shared formulae is maintained while chunk-reading Xlsx files --- CHANGELOG.md | 2 +- src/PhpSpreadsheet/Reader/Xlsx.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a3678bd..b3dd17a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Fixed -- Nothing. +- Ensure that the list of shared formulae is maintained when an xlsx file is chunked with readFilter[Issue #169](https://github.com/PHPOffice/PhpSpreadsheet/issues/1669). ## 1.15.0 - 2020-10-11 diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 73f91852..3a75edf6 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -661,6 +661,9 @@ class Xlsx extends BaseReader $coordinates = Coordinate::coordinateFromString($r); if (!$this->getReadFilter()->readCell($coordinates[0], (int) $coordinates[1], $docSheet->getTitle())) { + if (isset($c->f)) { + $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError'); + } ++$rowIndex; continue;