summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-04-08 20:37:09 +0200
committerEike Rathke <erack@redhat.com>2015-04-08 20:45:49 +0200
commit7940dabb8a93784a85db10160a8b20fb53b97474 (patch)
treedbbeb147d4185294dd635df01956e2f3bb97b68e
parent024a5d98324c101dc46c54c972df498741e23f2b (diff)
TableRef: table name without items references data only
Change-Id: I2d4e534444678ddf8243db7b3fb6fe66af9fa24f
-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 f5b122b838e3..0970d0194061 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4789,6 +4789,15 @@ bool ScCompiler::HandleTableRef()
{
case ScTableRefToken::TABLE:
{
+ // The table name without items references the table data,
+ // without headers or totals.
+ if (pDBData->HasHeader())
+ aRange.aStart.IncRow();
+ if (pDBData->HasTotals())
+ aRange.aEnd.IncRow(-1);
+ if (aRange.aEnd.Row() < aRange.aStart.Row())
+ bAddRange = false;
+
// Optional [] may follow.
if ((bGotToken = GetToken()) && mpToken->GetOpCode() == ocTableRefOpen)
{