[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sc/source

Eike Rathke erack at redhat.com
Tue Jun 5 08:31:47 UTC 2018


 sc/source/core/tool/compiler.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 999c9cd13c5c0d17569ce58a14b7047cf379eb7e
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jun 4 23:05:59 2018 +0200

    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 at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 2d330a5c48fd200db10fba7c40688221185c2dec)
    Reviewed-on: https://gerrit.libreoffice.org/55307
    Tested-by: Jenkins <ci at libreoffice.org>

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;


More information about the Libreoffice-commits mailing list