diff options
author | Eike Rathke <erack@redhat.com> | 2018-06-04 23:05:59 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-06-05 17:20:19 +0200 |
commit | 2f923aa12e2cbb759e504e06dd3efdfd9e552d34 (patch) | |
tree | ed8a2b43a0b4711e3991094ee52919b544702cd9 /sc | |
parent | cd51f388c96cafdf81303722c43c6025d9f0073e (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>
(cherry picked from commit 2d330a5c48fd200db10fba7c40688221185c2dec)
Reviewed-on: https://gerrit.libreoffice.org/55308
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index cf1a5b0eb01a..9e9edb77dc7a 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4577,7 +4577,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; |