Kaydet (Commit) f4ed9a5a authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#53640: Correctly cache source data coming from database backend.

It was due to a simple misplacement of nRow = 0.  Each record was
labeled row 0.  No wonder it screws up the result badly.

Change-Id: Ia94f42a62f98a9bd7c9d34df3606351bb487931b
üst 1db66c2a
......@@ -461,24 +461,27 @@ bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const
Reference<sdbc::XRow> xRow(xRowSet, UNO_QUERY_THROW);
std::vector<Bucket> aBuckets;
ScDPItemData aData;
for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol)
{
xRowSet->first();
ScDPItemData aData;
aBuckets.clear();
Field& rField = maFields[nCol];
SCROW nRow = 0;
do
{
SCROW nRow = 0;
short nFormatType = NUMBERFORMAT_UNDEFINED;
aData.SetEmpty();
getItemValue(*this, aData, xRow, aColTypes[nCol], nCol+1, rNullDate, nFormatType);
aBuckets.push_back(Bucket(aData, 0, nRow++));
aBuckets.push_back(Bucket(aData, 0, nRow));
if (!aData.IsEmpty())
{
maEmptyRows.insert_back(nRow, nRow+1, false);
SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
rField.mnNumFormat = pFormatter ? pFormatter->GetStandardFormat(nFormatType) : 0;
}
++nRow;
}
while (xRowSet->next());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment