Merge 8ac86cb254228d9faaa9d23e9936e840ef7d4dc3 into 4ff9717b0adc71ccf84c6e93b38e4188c77f39b4
This commit is contained in:
commit
e125f1b677
@ -64,6 +64,17 @@ class CellHelper
|
||||
return (gettype($value) === 'string' && $value !== '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the given value looks like a formula
|
||||
*
|
||||
* @param $value
|
||||
* @return bool whether the given value looks like a formula
|
||||
*/
|
||||
public static function isFormulaString($value)
|
||||
{
|
||||
return (strpos($value,'=') === 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the given value is numeric.
|
||||
* A numeric value is from type "integer" or "double" ("float" is not returned by gettype).
|
||||
|
@ -213,7 +213,9 @@ EOD;
|
||||
$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>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user