summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-06-04 23:05:59 +0200
committerEike Rathke <erack@redhat.com>2018-06-05 09:21:24 +0200
commit2d330a5c48fd200db10fba7c40688221185c2dec (patch)
tree72c87d7c5d798fda37b5ae6fc760c372edff53d2
parent92c745f95e2105104da7f0749d72e6cf761c1b58 (diff)
Resolves: tdf#117879 preserve formula after inline array error
Use FormulaError::NestedArray for now to be able to backport without new string resources. Introduce a more specific error in another change. Change-Id: I49bf731f0b17c81dc6a125718bf104e218e508cc Reviewed-on: https://gerrit.libreoffice.org/55300 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/tool/compiler.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index c91af03eed23..93065ddd0326 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4579,7 +4579,14 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
}
}
FormulaToken* pNewToken = static_cast<ScTokenArray*>(pArr)->Add( maRawToken.CreateToken());
- if (!pNewToken)
+ if (!pNewToken && eOp == ocArrayClose && pArr->OpCodeBefore( pArr->GetLen()) == ocArrayClose)
+ {
+ // Nested inline array or non-value/non-string in array. The
+ // original tokens are still in the ScTokenArray and not merged
+ // into an ScMatrixToken. Set error but keep on tokenizing.
+ SetError( FormulaError::NestedArray);
+ }
+ else if (!pNewToken)
{
SetError(FormulaError::CodeOverflow);
break;