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.');
|
||||
break;
|
||||
case DataType::TYPE_FORMULA:
|
||||
$formulaValue = $cell->getValue();
|
||||
if ($this->getParentWriter()->getPreCalculateFormulas()) {
|
||||
try {
|
||||
$formulaValue = $cell->getCalculatedValue();
|
||||
} catch (\Exception $e) {
|
||||
$formulaValue = $cell->getValue();
|
||||
} catch (Exception $e) {
|
||||
// don't do anything
|
||||
}
|
||||
}
|
||||
$objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
|
||||
if (is_numeric($formulaValue)) {
|
||||
|
|
Loading…
Reference in New Issue