summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-27 09:17:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-29 19:46:44 +0100
commit8e3a29110c8ad739bedeea90932663608d8d3935 (patch)
treec3c94973f74f22f538107fb18d9cf951ed8c05da
parent91228affd8996d9690b0abfa9544a18701ee3ec3 (diff)
ofz#20904 check bounds
Change-Id: I5d6d381ebd359b233b309e08131f3dda21310d80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89620 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/qa/unit/data/xls/pass/ofz20904-1.xlsbin0 -> 271413 bytes
-rw-r--r--sc/source/core/data/dociter.cxx11
2 files changed, 7 insertions, 4 deletions
diff --git a/sc/qa/unit/data/xls/pass/ofz20904-1.xls b/sc/qa/unit/data/xls/pass/ofz20904-1.xls
new file mode 100644
index 000000000000..44dbe8f6e222
--- /dev/null
+++ b/sc/qa/unit/data/xls/pass/ofz20904-1.xls
Binary files differ
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 2308a8477e20..bdbf1f2be63c 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -890,14 +890,17 @@ void ScCellIterator::init()
if (maStartPos.Tab() > maEndPos.Tab())
maStartPos.SetTab(maEndPos.Tab());
- maCurPos = maStartPos;
-
- if (!mpDoc->maTabs[maCurPos.Tab()])
+ if (!mpDoc->maTabs[maStartPos.Tab()])
{
assert(!"Table not found");
maStartPos = ScAddress(mpDoc->MaxCol()+1, mpDoc->MaxRow()+1, MAXTAB+1); // -> Abort on GetFirst.
- maCurPos = maStartPos;
}
+ else
+ {
+ maStartPos.SetCol(mpDoc->maTabs[maStartPos.Tab()]->ClampToAllocatedColumns(maStartPos.Col()));
+ }
+
+ maCurPos = maStartPos;
}
bool ScCellIterator::getCurrent()