Only calculate column autosize for a cell if it contains data (#2167)
Only calculate column autosize for a cell if it contains data
This commit is contained in:
parent
d2076fefab
commit
6f88d1b54e
|
|
@ -757,15 +757,17 @@ class Worksheet implements IComparable
|
||||||
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode()
|
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode()
|
||||||
);
|
);
|
||||||
|
|
||||||
$autoSizes[$this->cellCollection->getCurrentColumn()] = max(
|
if ($cellValue !== null && $cellValue !== '') {
|
||||||
(float) $autoSizes[$this->cellCollection->getCurrentColumn()],
|
$autoSizes[$this->cellCollection->getCurrentColumn()] = max(
|
||||||
(float) Shared\Font::calculateColumnWidth(
|
(float) $autoSizes[$this->cellCollection->getCurrentColumn()],
|
||||||
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(),
|
(float) Shared\Font::calculateColumnWidth(
|
||||||
$cellValue,
|
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(),
|
||||||
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(),
|
$cellValue,
|
||||||
$this->getParent()->getDefaultStyle()->getFont()
|
$this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(),
|
||||||
)
|
$this->getParent()->getDefaultStyle()->getFont()
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue