summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-06-30 17:28:39 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-01 10:11:06 +0200
commit5637b974912b29805be8af85d39086bab5697aa1 (patch)
tree0dce0faea5982e8490387e571072aa10abc364f1 /sc
parentdc219b0fe04d07a1e5c7c4c37bff94c29d4a1171 (diff)
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@redhat.com> Tested-by: Jenkins (cherry picked from commit f02207acc00787f29bc9e8992b1e2f3a182de43c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97506
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 9cdc0c8fc427..6e12d8100ed3 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2106,6 +2106,8 @@ sal_Int32 ScCompiler::NextSymbol(bool bInArray)
case ssSkipString:
case ssGetReference:
case ssSkipReference:
+ case ssGetTableRefItem:
+ case ssGetTableRefColumn:
break;
default:
if (eState == ssGetChar)
@@ -4265,12 +4267,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