Skip to content

Commit 5ae7414

Browse files
author
MarkBaker
committed
Performance Experiment for the String Table, to avoid creating empty cells; should also be slightly faster
1 parent d686a99 commit 5ae7414

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PhpSpreadsheet/Writer/Xlsx/StringTable.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
44

5+
use PhpOffice\PhpSpreadsheet\Cell\Cell;
56
use PhpOffice\PhpSpreadsheet\Cell\DataType;
67
use PhpOffice\PhpSpreadsheet\RichText\RichText;
78
use PhpOffice\PhpSpreadsheet\RichText\Run;
@@ -35,8 +36,9 @@ public function createStringTable(Worksheet $worksheet, $existingTable = null)
3536
$aFlippedStringTable = $this->flipStringTable($aStringTable);
3637

3738
// Loop through cells
38-
foreach ($worksheet->getCoordinates() as $coordinate) {
39-
$cell = $worksheet->getCell($coordinate);
39+
foreach ($worksheet->getCellCollection()->getCoordinates() as $coordinate) {
40+
/** @var Cell $cell */
41+
$cell = $worksheet->getCellCollection()->get($coordinate);
4042
$cellValue = $cell->getValue();
4143
if (
4244
!is_object($cellValue) &&

0 commit comments

Comments
 (0)