summaryrefslogtreecommitdiff
path: root/sc/source/core/data/dociter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/dociter.cxx')
-rw-r--r--sc/source/core/data/dociter.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index f501bb8da0d0..5331e8ac33ae 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -892,14 +892,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()])
{
OSL_FAIL("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()