Add cached value

This commit is contained in:
David Bonting 2022-02-21 13:47:42 +01:00
parent 71b800468f
commit ac2342b260
2 changed files with 6 additions and 2 deletions

View File

@ -73,6 +73,6 @@ class CellTypeHelper
*/
public static function isFormula($value)
{
return (strpos($value, '=') === 0);
return (is_array($value) || strpos($value, '=') === 0);
}
}

View File

@ -229,7 +229,11 @@ EOD;
$cellXML .= ' s="' . $styleId . '"';
if ($cell->isFormula()) {
$cellXML .= ' ><f>' . substr($cell->getValue(), 1) . '</f></c>';
if (is_array($cell->getValue())) {
$cellXML .= ' ><f>' . substr($cell->getValue()[0], 1) . '</f><v>' . $cell->getValue()[1] . '</v></c>';
} else {
$cellXML .= ' ><f>' . substr($cell->getValue(), 1) . '</f></c>';
}
} elseif ($cell->isString()) {
$cellXML .= $this->getCellXMLFragmentForNonEmptyString($cell->getValue());
} elseif ($cell->isBoolean()) {