#729 - fix shrink to fit + add test

shrinkToFit was not handled in StyleMerger so it was overwritten by the default cell style
StyleManager didn't add the property to the xml if shrinkToFit was used without alignment or text wrap.
Unit test
This commit is contained in:
István Ignácz committed 2020-08-14 16:39:52 +02:00
1 parent f702127d3a
commit 817e4f1f01
5 files changed
+36 -4

No files matched your search

@@ -186,7 +186,8 @@ class StyleBuilder
/**
* Set should shrink to fit
* @param bool $shrinkToFit
* @return void
* @return StyleBuilder
* @api
*/
public function setShouldShrinkToFit($shrinkToFit = true)
{
@@ -85,6 +85,9 @@ class StyleMerger
if (!$style->hasSetWrapText() && $baseStyle->shouldWrapText()) {
$styleToUpdate->setShouldWrapText();
}
if (!$style->hasSetShrinkToFit() && $baseStyle->shouldShrinkToFit()) {
$styleToUpdate->setShouldShrinkToFit();
}
if (!$style->hasSetCellAlignment() && $baseStyle->shouldApplyCellAlignment()) {
$styleToUpdate->setCellAlignment($baseStyle->getCellAlignment());
}