diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-05 04:09:48 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-05 04:13:13 +0100 |
commit | 235aaeb596c3701373889535f8fd8e29c92d333e (patch) | |
tree | 147d3b263620e8684da58c7e00ea18df7ae4f662 | |
parent | 1cdb049115a5a62bcd0febdd590d80049f67ebe6 (diff) |
don't set formula cells with possible error val clean, fdo#59039
Change-Id: Ide96d7f052ee4c8f56b33629ae48c6425a8ca19f
-rw-r--r-- | sc/inc/compiler.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlcelli.cxx | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index fe2451160ca9..4aa393d82ea6 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 5e745e9c2c0c..b64ab037d0ef 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)) { |