support merge_offset

This commit is contained in:
Jephté Clain 2025-01-24 18:22:05 +04:00
parent 1d2d8686c4
commit 967319ff0b
2 changed files with 5 additions and 2 deletions

View File

@ -415,14 +415,16 @@ class SpoutBuilder extends AbstractBuilder {
self::apply_params($row, $rowParams, ref_builder::ROW_PARAMS);
$mergeCells = $rowParams["merge_cells"] ?? null;
$mergeOffset = $rowParams["merge_offset"] ?? 0;
if ($mergeCells !== null) {
$currentRow = $this->currentRow;
foreach ($mergeCells as [$leftCol, $rightCol]) {
$this->mergeCells($leftCol, $this->currentRow, $rightCol, $this->currentRow);
$this->mergeCells($leftCol + $mergeOffset, $currentRow, $rightCol + $mergeOffset, $currentRow);
}
}
$this->ssWriter->addRow($row);
$this->currentRow++;
if ($differentOddEven) $this->oddEvenIndex++;
}

View File

@ -48,6 +48,7 @@ class ref_builder {
const ROW_PARAMS = [
"->setHeight" => ["float"],
"merge_cells" => "array",
"merge_offset" => "int",
];
const COLORS = [