[Libreoffice-commits] .: Branch 'feature/calc-xml-source' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 25 16:55:35 PDT 2012


 sc/source/filter/xml/xmlcelli.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit ee023e0baddf409085304ca534e2327579490699
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Sep 25 19:53:26 2012 -0400

    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

diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 3b6ca50..f82738c 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.
     }
 }
 


More information about the Libreoffice-commits mailing list