[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Oct 20 06:33:31 PDT 2010
sc/source/core/data/dociter.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit 167cff40a6bca04fc5e022919723a974f7a45d0b
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Oct 20 15:29:56 2010 +0200
Fixed a crash on importing docs with database functions.
When iterating through an empty column via ScDBQueryDataIterator it
caused segfalut. (fdo#30861)
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index f36a55b..b7d52cd 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -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);
More information about the Libreoffice-commits
mailing list