Kaydet (Commit) 896dd396 authored tarafından Eike Rathke's avatar Eike Rathke

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
üst 141c27de
...@@ -1042,7 +1042,10 @@ OUString ScFormulaCell::GetFormula( sc::CompileFormulaContext& rCxt ) const ...@@ -1042,7 +1042,10 @@ OUString ScFormulaCell::GetFormula( sc::CompileFormulaContext& rCxt ) const
OUStringBuffer aBuf; OUStringBuffer aBuf;
if (pCode->GetCodeError() != FormulaError::NONE && !pCode->GetLen()) 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(); return aBuf.makeStringAndClear();
} }
else if( cMatrixFlag == MM_REFERENCE ) else if( cMatrixFlag == MM_REFERENCE )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment