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

Use the same algorithm for database initialization.

üst b9880a79
...@@ -518,20 +518,31 @@ bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const ...@@ -518,20 +518,31 @@ bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const
// Now get the data rows. // Now get the data rows.
Reference<sdbc::XRow> xRow(xRowSet, UNO_QUERY_THROW); Reference<sdbc::XRow> xRow(xRowSet, UNO_QUERY_THROW);
xRowSet->first();
ScDPItemData aData; std::vector<Bucket> aBuckets;
do for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol)
{ {
for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol) xRowSet->first();
ScDPItemData aData;
aBuckets.clear();
Field& rField = maFields[nCol];
do
{ {
SCROW nRow = 0;
short nFormatType = NUMBERFORMAT_UNDEFINED; short nFormatType = NUMBERFORMAT_UNDEFINED;
getItemValue(aData, xRow, aColTypes[nCol], nCol+1, rNullDate, nFormatType); getItemValue(aData, xRow, aColTypes[nCol], nCol+1, rNullDate, nFormatType);
SvNumberFormatter* pFormatter = mpDoc->GetFormatTable(); aBuckets.push_back(Bucket(aData, 0, nRow++));
sal_uLong nNumFormat = pFormatter ? pFormatter->GetStandardFormat(nFormatType) : 0; if (!aData.IsEmpty())
AddData(nCol, aData, nNumFormat); {
maEmptyRows.insert_back(nRow, nRow+1, false);
SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
rField.mnNumFormat = pFormatter ? pFormatter->GetStandardFormat(nFormatType) : 0;
}
} }
while (xRowSet->next());
processBuckets(aBuckets, rField);
} }
while (xRowSet->next());
xRowSet->beforeFirst(); xRowSet->beforeFirst();
......
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