[Libreoffice-commits] .: sc/source

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


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

New commits:
commit 4d9bf254804138424421744edc5cf308cfb97042
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