[Libreoffice-commits] .: sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 4 19:10:27 PST 2013


 sc/inc/compiler.hxx               |    2 +-
 sc/source/filter/xml/xmlcelli.cxx |   10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 3cd31cd46f38e00d4fb31cf055b9bcbb5e94e5db
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jan 5 04:09:48 2013 +0100

    don't set formula cells with possible error val clean, fdo#59039
    
    Change-Id: Ide96d7f052ee4c8f56b33629ae48c6425a8ca19f

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index fe24511..4aa393d 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -350,7 +350,6 @@ private:
     bool IsDBRange( const String& );
     bool IsColRowName( const String& );
     bool IsBoolean( const String& );
-    bool IsErrorConstant( const String& );
     void AutoCorrectParsedSymbol();
 
     void SetRelNameReference();
@@ -387,6 +386,7 @@ public:
 
     // Check if it is a valid english function name
     bool IsEnglishSymbol( const String& rName );
+    bool IsErrorConstant( const String& );
 
     //! _either_ CompileForFAP _or_ AutoCorrection, _not_ both
     // #i101512# SetCompileForFAP is in formula::FormulaCompiler
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 2369dce..b67496c 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -47,6 +47,7 @@
 #include "scerrors.hxx"
 #include "editutil.hxx"
 #include "cell.hxx"
+#include "compiler.hxx"
 
 
 #include <xmloff/xmltkmap.hxx>
@@ -726,8 +727,13 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
     {
         if( bFormulaTextResult && pOUTextValue )
         {
-            pFCell->SetHybridString( *pOUTextValue );
-            pFCell->ResetDirty();
+            static ScCompiler aComp(NULL, ScAddress());
+            aComp.SetGrammar(formula::FormulaGrammar::GRAM_ODFF);
+            if(!aComp.IsErrorConstant(*pOUTextValue))
+            {
+                pFCell->SetHybridString( *pOUTextValue );
+                pFCell->ResetDirty();
+            }
         }
         else if (!rtl::math::isNan(fValue))
         {


More information about the Libreoffice-commits mailing list