summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/dociter.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 686e426c8d52..9597fcedbbfd 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1079,8 +1079,8 @@ void ScQueryCellIterator::InitPos()
nRow = maParam.nRow1;
if (maParam.bHasHeader && maParam.bByRow)
++nRow;
- ScColumn* pCol = &(rDoc.maTabs[nTab])->aCol[nCol];
- maCurPos = pCol->maCells.position(nRow);
+ const ScColumn& rCol = rDoc.maTabs[nTab]->CreateColumnIfNotExists(nCol);
+ maCurPos = rCol.maCells.position(nRow);
}
void ScQueryCellIterator::IncPos()