summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-04-07 23:08:08 +0200
committerEike Rathke <erack@redhat.com>2015-04-07 23:23:04 +0200
commitc012af28e334c3f01430ec46e1d7b1ed87b55c54 (patch)
tree5e0eeba68c14f033f94c0d1884913dd93caa3a42 /sc
parent576b14ead012993b58a5217c9c8e863f59fc5088 (diff)
TableRef: implement more keyword cases
Change-Id: Ib37bfb1b8721d3f6729ce5c312863ffa6a1f76d4
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx36
1 files changed, 29 insertions, 7 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 5512e382ef16..f3b68f53645e 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4800,7 +4800,10 @@ bool ScCompiler::HandleTableRef()
break;
case ScTableRefToken::HEADERS:
{
- aRange.aEnd.SetRow( aRange.aStart.Row());
+ if (pDBData->HasHeader())
+ aRange.aEnd.SetRow( aRange.aStart.Row());
+ else
+ bAddRange = false;
bForwardToClose = true;
}
break;
@@ -4808,9 +4811,11 @@ bool ScCompiler::HandleTableRef()
{
if (pDBData->HasHeader())
aRange.aStart.IncRow();
- /* TODO: this assumes totals to be present, they need to
- * be implemented at the table. */
- if (aRange.aEnd.Row() - aRange.aStart.Row() >= 1)
+ }
+ // fallthru
+ case ScTableRefToken::HEADERS_DATA:
+ {
+ if (pDBData->HasTotals())
aRange.aEnd.IncRow(-1);
if (aRange.aEnd.Row() < aRange.aStart.Row())
{
@@ -4823,14 +4828,31 @@ bool ScCompiler::HandleTableRef()
break;
case ScTableRefToken::TOTALS:
{
- aRange.aStart.SetRow( aRange.aEnd.Row());
+ if (pDBData->HasTotals())
+ aRange.aStart.SetRow( aRange.aEnd.Row());
+ else
+ bAddRange = false;
bForwardToClose = true;
}
break;
- default:
- /* TODO: implement all other cases. */
+ case ScTableRefToken::DATA_TOTALS:
+ {
+ if (pDBData->HasHeader())
+ aRange.aStart.IncRow();
+ if (aRange.aEnd.Row() < aRange.aStart.Row())
+ {
+ /* TODO: add RefData with deleted rows to generate
+ * #REF! error? */
+ bAddRange = false;
+ }
+ bForwardToClose = true;
+ }
+ break;
+ case ScTableRefToken::THIS_ROW:
+ /* TODO: implement this. */
SetError(errUnknownToken);
bAddRange = false;
+ break;
}
if (bAddRange)
{