Ods writer repects PreCalculateFormulas flag
The OpenDocument Writer did not respect the "preCalculateFormulas" flag that can be set to speed up saving process, now it does. Closes #142
This commit is contained in:
parent
4c42afe7b8
commit
77199c9877
|
@ -224,10 +224,13 @@ class Content extends WriterPart
|
||||||
throw new Exception('Writing of error not implemented yet.');
|
throw new Exception('Writing of error not implemented yet.');
|
||||||
break;
|
break;
|
||||||
case DataType::TYPE_FORMULA:
|
case DataType::TYPE_FORMULA:
|
||||||
|
$formulaValue = $cell->getValue();
|
||||||
|
if ($this->getParentWriter()->getPreCalculateFormulas()) {
|
||||||
try {
|
try {
|
||||||
$formulaValue = $cell->getCalculatedValue();
|
$formulaValue = $cell->getCalculatedValue();
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
$formulaValue = $cell->getValue();
|
// don't do anything
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
|
$objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
|
||||||
if (is_numeric($formulaValue)) {
|
if (is_numeric($formulaValue)) {
|
||||||
|
|
Loading…
Reference in New Issue