summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-02-07 22:21:51 +0100
committerEike Rathke <erack@redhat.com>2018-02-07 22:25:11 +0100
commit30083601334279f33a3021dfe7d22970d02c8e9e (patch)
tree93bfc04a462ea3348d538d60de57818b6a7058f1 /sc
parent1fcf76b8f33ddca3f00256e3c41104314988a9f4 (diff)
tdf#115493 postpone name resolution after unsuccessful IsNamedRange()
... for names used in named expressions when compiling during import and collecting named expressions, to not match an arbitrary other name. Change-Id: I02a92747a1485b46873281de98879a89385d4622
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index b029b560e5d5..68e814e23c44 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4275,6 +4275,15 @@ bool ScCompiler::NextNewToken( bool bInArray )
if (IsNamedRange( aUpper ))
return true;
+
+ // Compiling a named expression during collecting them in import shall
+ // not match arbitrary names that otherwise if all named expressions
+ // were present would be recognized as named expression. Such name will
+ // flag an error below and will be recompiled in a second step later
+ // with ScRangeData::CompileUnresolvedXML()
+ if (meExtendedErrorDetection == EXTENDED_ERROR_DETECTION_NAME_NO_BREAK && pDoc->IsImportingXML())
+ break; // while
+
// Preserve case of file names in external references.
bool bInvalidExternalNameRange;
if (IsExternalNamedRange( aOrg, bInvalidExternalNameRange ))