diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-09-25 19:53:26 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-09-25 19:56:46 -0400 |
commit | 4d9bf254804138424421744edc5cf308cfb97042 (patch) | |
tree | cc88833ba0d66f321936bb56d5192d9bc9345ef6 /sc | |
parent | f1fcf02847a84dd35ce27cfe8f956b40cfd94cf0 (diff) |
Leave the formula cell dirty when a cached result is not given.
This sometimes is the case especially with hand-crafted flat ODS.
Change-Id: I0db374e424b250bcded526149ed2c27aabc3d722
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 3b6ca50a735f..f82738c1cfbf 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -135,6 +135,8 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport, bSolarMutexLocked(false), bFormulaTextResult(false) { + rtl::math::setNan(&fValue); // NaN by default + rXMLImport.SetRemoveLastChar(false); rXMLImport.GetTables().AddColumn(bTempIsCovered); const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -732,10 +734,17 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const if(pFCell) { if( bFormulaTextResult && pOUTextValue ) + { pFCell->SetHybridString( *pOUTextValue ); - else - pFCell->SetHybridDouble( fValue ); - pFCell->ResetDirty(); + pFCell->ResetDirty(); + } + else if (!rtl::math::isNan(fValue)) + { + pFCell->SetHybridDouble(fValue); + pFCell->ResetDirty(); + } + + // Leave the cell dirty when the cached result is not given. } } |