Code review changes
This commit is contained in:
1 parent
197fb9987a
commit
11d91e1740
20 files changed
+105
-59
No files matched your search
@@ -4,7 +4,6 @@ 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;
|
||||
@@ -186,13 +185,13 @@ EOD;
|
||||
*/
|
||||
private function applyStyleAndGetCellXML(Cell $cell, Style &$rowStyle, $rowIndexOneBased, $columnIndexZeroBased)
|
||||
{
|
||||
if ($cell->getStyle() instanceof EmptyStyle) {
|
||||
if ($cell->getStyle()->isEmpty()) {
|
||||
$cell->setStyle($rowStyle);
|
||||
|
||||
$extraStyle = $this->styleManager->applyExtraStylesIfNeeded($cell);
|
||||
$managedStyle = $this->styleManager->applyExtraStylesIfNeeded($cell);
|
||||
|
||||
if ($extraStyle) {
|
||||
$registeredStyle = $this->styleManager->registerStyle($extraStyle);
|
||||
if ($managedStyle->isUpdated()) {
|
||||
$registeredStyle = $this->styleManager->registerStyle($managedStyle->getStyle());
|
||||
} else {
|
||||
$registeredStyle = $rowStyle = $this->styleManager->registerStyle($rowStyle);
|
||||
}
|
||||
@@ -200,7 +199,14 @@ EOD;
|
||||
$mergedCellAndRowStyle = $this->styleMerger->merge($cell->getStyle(), $rowStyle);
|
||||
$cell->setStyle($mergedCellAndRowStyle);
|
||||
|
||||
$newCellStyle = $this->styleManager->applyExtraStylesIfNeeded($cell) ?: $mergedCellAndRowStyle;
|
||||
$managedStyle = $this->styleManager->applyExtraStylesIfNeeded($cell);
|
||||
|
||||
if ($managedStyle->isUpdated()) {
|
||||
$newCellStyle = $managedStyle->getStyle();
|
||||
} else {
|
||||
$newCellStyle = $mergedCellAndRowStyle;
|
||||
}
|
||||
|
||||
$registeredStyle = $this->styleManager->registerStyle($newCellStyle);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user