Skip to content

Commit

Permalink
Fix col styles
Browse files Browse the repository at this point in the history
  • Loading branch information
aVadim483 committed Sep 7, 2022
1 parent cbec0d0 commit de70860
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/FastExcelWriter/Sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ public function setColOptions($arg1, array $arg2 = null)
}
}
}
$this->clearSummary();

return $this;
}
Expand Down Expand Up @@ -490,6 +491,7 @@ public function setColWidth($col, $width)
}
}
}
$this->clearSummary();

return $this;
}
Expand Down Expand Up @@ -545,6 +547,7 @@ public function setColStyle($col, $style)
}
}
}
$this->clearSummary();

return $this;
}
Expand Down Expand Up @@ -585,6 +588,7 @@ public function setColFormula($col, string $formula)
public function setColFormat($col, $format)
{
$this->setColStyle($col, ['format' => $format]);
$this->clearSummary();

return $this;
}
Expand Down Expand Up @@ -918,6 +922,16 @@ protected function _columnWidth($colNum, $cellValue, $numberFormat, $style)
}
}

protected function clearSummary()
{
if ($this->sheetStylesSummary) {
$this->sheetStylesSummary = [];
}
if ($this->colStylesSummary) {
$this->colStylesSummary = [];
}
}

/**
* @param array $style
*
Expand All @@ -926,6 +940,7 @@ protected function _columnWidth($colNum, $cellValue, $numberFormat, $style)
public function setDefaultStyle(array $style)
{
$this->defaultStyle = $style;
$this->clearSummary();

return $this;
}
Expand Down

0 comments on commit de70860

Please sign in to comment.