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

Use the same algorithm for database initialization.

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