diff --git a/src/Spout/Writer/Common/Manager/Style/StyleRegistry.php b/src/Spout/Writer/Common/Manager/Style/StyleRegistry.php index d2f5bc3..325cc3d 100644 --- a/src/Spout/Writer/Common/Manager/Style/StyleRegistry.php +++ b/src/Spout/Writer/Common/Manager/Style/StyleRegistry.php @@ -12,13 +12,10 @@ class StyleRegistry { /** @var array [SERIALIZED_STYLE] => [STYLE_ID] mapping table, keeping track of the registered styles */ protected $serializedStyleToStyleIdMappingTable = []; - protected $serializedNumberFormatToFormatIdMappingTable = []; /** @var array [STYLE_ID] => [STYLE] mapping table, keeping track of the registered styles */ protected $styleIdToStyleMappingTable = []; - protected $numberFormats = []; - /** * @param Style $defaultStyle */ diff --git a/src/Spout/Writer/XLSX/Manager/Style/StyleManager.php b/src/Spout/Writer/XLSX/Manager/Style/StyleManager.php index f83f16b..0a72ba9 100644 --- a/src/Spout/Writer/XLSX/Manager/Style/StyleManager.php +++ b/src/Spout/Writer/XLSX/Manager/Style/StyleManager.php @@ -72,8 +72,9 @@ EOD; $content = ''; /** @var NumberFormat $format */ - foreach ($registeredFormats as $format) { - + foreach ($registeredFormats as $styleId) { + $style = $this->styleRegistry->getStyleFromStyleId($styleId); + $format = $style->getNumberFormat(); $content .= ''; } $content .= '';