[Libreoffice-commits] core.git: sc/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 30 20:12:22 UTC 2020


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

New commits:
commit 31951265f541c9f5acf424674e2d1d97c0f3b8c2
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Tue Jun 30 17:28:39 2020 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Tue Jun 30 22:11: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 <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 7a57db4bb4df..3dc18b0fe5dc 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2104,6 +2104,8 @@ sal_Int32 ScCompiler::NextSymbol(bool bInArray)
                 case ssSkipString:
                 case ssGetReference:
                 case ssSkipReference:
+                case ssGetTableRefItem:
+                case ssGetTableRefColumn:
                     break;
                 default:
                     if (eState == ssGetChar)
@@ -4263,12 +4265,20 @@ bool ScCompiler::NextNewToken( bool bInArray )
         bMayBeFuncName = ScGlobal::getCharClassPtr()->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


More information about the Libreoffice-commits mailing list