Apply default row style in WorkbookManager

Instead of doing it in the Writer
This commit is contained in:
Adrien Loison committed 2017-11-05 14:13:22 +01:00
1 parent 3d0f108b1d
commit 8aec9ea992
6 files changed
+50 -37

No files matched your search

@@ -7,6 +7,7 @@ use Box\Spout\Writer\Common\Creator\InternalEntityFactory;
use Box\Spout\Writer\Common\Creator\ManagerFactoryInterface;
use Box\Spout\Writer\Common\Entity\Options;
use Box\Spout\Writer\Common\Manager\SheetManager;
use Box\Spout\Writer\Common\Manager\Style\StyleMerger;
use Box\Spout\Writer\XLSX\Manager\SharedStringsManager;
use Box\Spout\Writer\XLSX\Manager\Style\StyleManager;
use Box\Spout\Writer\XLSX\Manager\Style\StyleRegistry;
@@ -49,6 +50,7 @@ class ManagerFactory implements ManagerFactoryInterface
$xlFolder = $fileSystemHelper->getXlFolder();
$sharedStringsManager = $this->createSharedStringsManager($xlFolder);
$styleMerger = $this->createStyleMerger();
$styleManager = $this->createStyleManager($optionsManager);
$worksheetManager = $this->createWorksheetManager($optionsManager, $styleManager, $sharedStringsManager);
@@ -57,6 +59,7 @@ class ManagerFactory implements ManagerFactoryInterface
$optionsManager,
$worksheetManager,
$styleManager,
$styleMerger,
$fileSystemHelper,
$this->entityFactory,
$this
@@ -112,6 +115,14 @@ class ManagerFactory implements ManagerFactoryInterface
return new StyleRegistry($defaultRowStyle);
}
/**
* @return StyleMerger
*/
private function createStyleMerger()
{
return new StyleMerger();
}
/**
* @param string $xlFolder Path to the "xl" folder
* @return SharedStringsManager