Added support for cell formats when writing Excel files
This commit is contained in:
1 parent
16a2f91a22
commit
40aecd7b90
6 files changed
+277
-2
No files matched your search
@@ -147,6 +147,18 @@ class StyleBuilder
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Sets a format
|
||||
*
|
||||
* @api
|
||||
* @param string $format Format
|
||||
* @return StyleBuilder
|
||||
*/
|
||||
public function setFormat($format)
|
||||
{
|
||||
$this->style->setFormat($format);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the configured style. The style is cached and can be reused.
|
||||
|
||||
@@ -88,6 +88,9 @@ class StyleMerger
|
||||
if (!$style->getBorder() && $baseStyle->shouldApplyBorder()) {
|
||||
$styleToUpdate->setBorder($baseStyle->getBorder());
|
||||
}
|
||||
if (!$style->getFormat() && $baseStyle->shouldApplyFormat()) {
|
||||
$styleToUpdate->setFormat($baseStyle->getFormat());
|
||||
}
|
||||
if (!$style->shouldApplyBackgroundColor() && $baseStyle->shouldApplyBackgroundColor()) {
|
||||
$styleToUpdate->setBackgroundColor($baseStyle->getBackgroundColor());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user