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

@ -213,7 +213,9 @@ EOD;
$cellXML = '<c r="' . $columnIndex . $rowIndex . '"'; $cellXML = '<c r="' . $columnIndex . $rowIndex . '"';
$cellXML .= ' s="' . $styleId . '"'; $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); $cellXML .= $this->getCellXMLFragmentForNonEmptyString($cellValue);
} else if (CellHelper::isBoolean($cellValue)) { } else if (CellHelper::isBoolean($cellValue)) {
$cellXML .= ' t="b"><v>' . intval($cellValue) . '</v></c>'; $cellXML .= ' t="b"><v>' . intval($cellValue) . '</v></c>';