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:12:05 +0100 |
commit | 3cd31cd46f38e00d4fb31cf055b9bcbb5e94e5db (patch) | |
tree | 5fd613e86cfbd474a911561b114db1e5576a9899 | |
parent | 3e102b36977a62931b0de4176bcd92a307408d8b (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 2369dce6b213..b67496c0cdfd 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)) { |