summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-01-05 13:28:36 +0100
committerEike Rathke <erack@redhat.com>2017-01-05 13:29:49 +0100
commit896dd3962cd7e62bb2a9ebc6f97ff77936ec06a8 (patch)
treeced4ac11a8e35f8dacc3bedc14bb8fc5056c5042
parent141c27de8af0652a77d993ca4c8201dabbead655 (diff)
tdf#105024 use context to generate "error only" formula string
The ScGlobal::GetErrorString() shortcut produced error constants in the localized UI language, which was wrong anyway when storing ODFF. Use compiler with context instead to generate the proper symbols. However, this currently maps all not defined Err:xxx to #NULL! so to preserve those additional work is needed. Change-Id: I1de7621d6349d5b00a5aac1cedc9f265c78c7db1
-rw-r--r--sc/source/core/data/formulacell.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 198077b56c4c..a9cb0e8c7764 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1042,7 +1042,10 @@ OUString ScFormulaCell::GetFormula( sc::CompileFormulaContext& rCxt ) const
OUStringBuffer aBuf;
if (pCode->GetCodeError() != FormulaError::NONE && !pCode->GetLen())
{
- aBuf = OUStringBuffer( ScGlobal::GetErrorString( pCode->GetCodeError()));
+ ScTokenArray aCode;
+ aCode.AddToken( FormulaErrorToken( pCode->GetCodeError()));
+ ScCompiler aComp(rCxt, aPos, aCode);
+ aComp.CreateStringFromTokenArray(aBuf);
return aBuf.makeStringAndClear();
}
else if( cMatrixFlag == MM_REFERENCE )