ajout rotation et autofit

This commit is contained in:
Jephté Clain 2025-01-23 16:08:57 +04:00
parent b721c16335
commit 909cd849cc
2 changed files with 4 additions and 0 deletions

View File

@ -91,6 +91,7 @@ class SpoutBuilder extends AbstractBuilder {
if (($align = $cell["align"] ?? null) !== null) $style->setCellAlignment($align);
if (($align = $cell["valign"] ?? null) !== null) $style->setCellVerticalAlignment($align);
if (($wrap = $cell["wrap"] ?? null) !== null) $style->setShouldWrapText($wrap);
if (($rotation = $cell["rotation"] ?? null) !== null) $style->setTextRotation($rotation);
if (($format = $cell["format"] ?? null) !== null) $style->setFormat($format);
if (($border = $cell["border"] ?? null) !== null) {
if (is_string($border)) {
@ -128,6 +129,7 @@ class SpoutBuilder extends AbstractBuilder {
self::add_border_part($parts, "left", $border["left"] ?? null);
if ($parts !== null) $style->setBorder(new Border(...$parts));
}
if (($autofit = $cell["autofit"] ?? null) !== null) $style->setShouldShrinkToFit($autofit);
return $style;
}

View File

@ -82,6 +82,7 @@ class ref_builder {
"align" => "string",
"valign" => "string",
"wrap" => "bool",
"rotation" => "int",
"format" => "string",
"border" => [
"top" => ["color" => "string", "width" => "string", "style" => "string"],
@ -89,5 +90,6 @@ class ref_builder {
"bottom" => ["color" => "string", "width" => "string", "style" => "string"],
"left" => ["color" => "string", "width" => "string", "style" => "string"],
],
"autofit" => "bool",
];
}