Fixed a crash on importing docs with database functions.
When iterating through an empty column via ScDBQueryDataIterator it caused segfalut. (fdo#30861)
This commit is contained in:
parent
b5543aa005
commit
6545200f25
1 changed files with 4 additions and 0 deletions
|
@ -543,6 +543,10 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue)
|
|||
}
|
||||
|
||||
SCSIZE nCellCount = mpDoc->GetCellCount(nTab, nCol);
|
||||
if (!nCellCount)
|
||||
// No cells found in this column. Bail out.
|
||||
return false;
|
||||
|
||||
SCROW nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, nColRow);
|
||||
while ( (nColRow < nCellCount) && (nThisRow < nRow) )
|
||||
nThisRow = ScDBQueryDataIterator::GetRowByColEntryIndex(*mpDoc, nTab, nCol, ++nColRow);
|
||||
|
|
Loading…
Reference in a new issue