diff --git a/src/PhpSpreadsheet/Writer/Xlsx.php b/src/PhpSpreadsheet/Writer/Xlsx.php index 6de8097c7..a968c3795 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx.php +++ b/src/PhpSpreadsheet/Writer/Xlsx.php @@ -335,7 +335,7 @@ class Xlsx extends BaseWriter if ($this->spreadSheet->hasInCellDrawings()) { $richDataDrawing = new RichDataDrawing(); $richDataFiles = $richDataDrawing->generateFiles($this->spreadSheet); - $richDataCount = count($richDataFiles); + $richDataCount = count($richDataDrawing->getDrawings()); // Add all Rich Data files to ZIP foreach ($richDataFiles as $path => $content) { diff --git a/src/PhpSpreadsheet/Writer/Xlsx/RichDataDrawing.php b/src/PhpSpreadsheet/Writer/Xlsx/RichDataDrawing.php index 44b47b40d..d0300a64b 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/RichDataDrawing.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/RichDataDrawing.php @@ -51,6 +51,14 @@ class RichDataDrawing ]; } + /** + * @return Drawing[] + */ + public function getDrawings(): array + { + return $this->drawings; + } + private function writeRdrichvalueXML(): string { $xml = new XMLWriter(XMLWriter::STORAGE_MEMORY);