From b399c09dd5645f82462db147be8f6acea1c8e276 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Thu, 5 May 2022 10:05:32 +0200 Subject: [PATCH] Performance Experiment for the String Table, to avoid creating empty cells; should also be slightly faster --- src/PhpSpreadsheet/Writer/Xlsx/StringTable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php b/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php index f9a2e711c..3c5b60508 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php @@ -35,8 +35,8 @@ class StringTable extends WriterPart $aFlippedStringTable = $this->flipStringTable($aStringTable); // Loop through cells - foreach ($worksheet->getCoordinates() as $coordinate) { - $cell = $worksheet->getCell($coordinate); + foreach ($worksheet->getCellCollection()->getCoordinates() as $coordinate) { + $cell = $worksheet->getCellCollection()->get($coordinate); $cellValue = $cell->getValue(); if ( !is_object($cellValue) &&