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 16:47:06 +0000
commitd321ba87f5ab67f939034c59846d2a3d0ab7e9b4 (patch)
tree7f49e8e4ab2430c451adad9f3c04581e85601517
parentd4b57240aabece5550cc9ac448ff90301ed6ec3d (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 (cherry picked from commit 896dd3962cd7e62bb2a9ebc6f97ff77936ec06a8) Reviewed-on: https://gerrit.libreoffice.org/32752 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
-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 f59ad0933a50..6616439a5f11 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 )