diff options
-rw-r--r-- | sc/source/core/data/dociter.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index d6d59cedcc2d..2d8808e4b0cb 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -565,7 +565,11 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) SCROW nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, nColRow); while ( (nColRow < nCellCount) && (nThisRow < nRow) ) - nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, ++nColRow); + { + ++nColRow; + if(nColRow < nCellCount) + nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, nColRow); + } if ( nColRow < nCellCount && nThisRow <= mpParam->nRow2 ) { |