Update Worksheet.php

Supporting *writing* formulas in XLSX files is truly trivial.
This commit is contained in:
Stephen Sweetland 2017-05-25 11:07:36 +01:00 committed by GitHub
parent 1d38fca715
commit 8ac86cb254

View File

@ -212,8 +212,10 @@ EOD;
$columnIndex = CellHelper::getCellIndexFromColumnIndex($cellNumber);
$cellXML = '<c r="' . $columnIndex . $rowIndex . '"';
$cellXML .= ' s="' . $styleId . '"';
if (CellHelper::isNonEmptyString($cellValue)) {
if (CellHelper::isFormulaString($cellValue)) {
$cellXML .= '><f>'.substr($cellValue,1).'</f><v>0</v></c>'; // seriously, that's it.
} else if (CellHelper::isNonEmptyString($cellValue)) {
$cellXML .= $this->getCellXMLFragmentForNonEmptyString($cellValue);
} else if (CellHelper::isBoolean($cellValue)) {
$cellXML .= ' t="b"><v>' . intval($cellValue) . '</v></c>';