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

New commits:
commit acd5f39dfe9262a43a4d8ff898c5b16a52e8c830
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Tue Jun 30 17:28:39 2020 +0200
Commit:     Gabor Kelemen <kelemen.gab...@nisz.hu>
CommitDate: Tue Jul 28 13:55:26 2020 +0200

    Resolves: tdf#131424 separator in TableRef column specifier is valid
    
    Even only a separator or any operator single character.
    
    Change-Id: I102dd7fd49c1a6a7f1d8c39f4a6139a51dbebe51
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97535
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 31951265f541c9f5acf424674e2d1d97c0f3b8c2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97507
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 56641c9717f4fadcc81248c58c7762314270d721)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99591
    Tested-by: Gabor Kelemen <kelemen.gab...@nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gab...@nisz.hu>

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index f0c755fa1b8c..e31ab2731fa3 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2080,6 +2080,8 @@ sal_Int32 ScCompiler::NextSymbol(bool bInArray)
                 case ssSkipString:
                 case ssGetReference:
                 case ssSkipReference:
+                case ssGetTableRefItem:
+                case ssGetTableRefColumn:
                     break;
                 default:
                     if (eState == ssGetChar)
@@ -4234,12 +4236,20 @@ bool ScCompiler::NextNewToken( bool bInArray )
         bMayBeFuncName = ScGlobal::pCharClass->isLetter( aTmpStr, 0 );
         bAsciiNonAlnum = false;
     }
-    if (bAsciiNonAlnum && cSymbol[1] == 0)
+
+    // Within a TableRef anything except an unescaped '[' or ']' is an item
+    // or a column specifier, do not attempt to recognize any other single
+    // operator there so even [,] or [+] for a single character column
+    // specifier works. Note that space between two ocTableRefOpen is not
+    // supported (Table[ [ColumnSpec]]), not only here. Note also that Table[]
+    // without any item or column specifier is valid.
+    if (bAsciiNonAlnum && cSymbol[1] == 0 && (eLastOp != ocTableRefOpen || 
cSymbol[0] == '[' || cSymbol[0] == ']'))
     {
         // Shortcut for operators and separators that need no further checks 
or upper.
         if (IsOpCode( OUString( cSymbol), bInArray ))
             return true;
     }
+
     if ( bMayBeFuncName )
     {
         // a function name must be followed by a parenthesis
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to