Begin optimize xlsx write
This commit is contained in:
1 parent
91f756be0b
commit
57b6e87a65
4 files changed
+35
-8
No files matched your search
@@ -4,6 +4,7 @@ namespace Box\Spout\Writer\XLSX\Manager;
|
||||
|
||||
use Box\Spout\Common\Entity\Cell;
|
||||
use Box\Spout\Common\Entity\Row;
|
||||
use Box\Spout\Common\Entity\Style\EmptyStyle;
|
||||
use Box\Spout\Common\Entity\Style\Style;
|
||||
use Box\Spout\Common\Exception\InvalidArgumentException;
|
||||
use Box\Spout\Common\Exception\IOException;
|
||||
@@ -185,11 +186,14 @@ EOD;
|
||||
*/
|
||||
private function applyStyleAndGetCellXML(Cell $cell, Style $rowStyle, $rowIndexOneBased, $columnIndexZeroBased)
|
||||
{
|
||||
// Apply row and extra styles
|
||||
$mergedCellAndRowStyle = $this->styleMerger->merge($cell->getStyle(), $rowStyle);
|
||||
$cell->setStyle($mergedCellAndRowStyle);
|
||||
$newCellStyle = $this->styleManager->applyExtraStylesIfNeeded($cell);
|
||||
if ($cell->getStyle() instanceof EmptyStyle) {
|
||||
$cell->setStyle($rowStyle);
|
||||
} else {
|
||||
$mergedCellAndRowStyle = $this->styleMerger->merge($cell->getStyle(), $rowStyle);
|
||||
$cell->setStyle($mergedCellAndRowStyle);
|
||||
}
|
||||
|
||||
$newCellStyle = $this->styleManager->applyExtraStylesIfNeeded($cell);
|
||||
$registeredStyle = $this->styleManager->registerStyle($newCellStyle);
|
||||
|
||||
return $this->getCellXML($rowIndexOneBased, $columnIndexZeroBased, $cell, $registeredStyle->getId());
|
||||
|
||||
Reference in new issue
Block a user