summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-03-15 15:33:34 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-03-15 15:41:23 -0400
commit3507f0f02d68261db62d4d6a3c5f4ccebd096835 (patch)
tree51b4bda5ccc6df9fdca6fdc723d22fe2b41e6c97 /sc
parentb9880a798a841e9acd7b7fbc24eac14ed49459b2 (diff)
Use the same algorithm for database initialization.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/dpcache.cxx27
1 files changed, 19 insertions, 8 deletions
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index caa51233ae43..7a07ee270db0 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -518,20 +518,31 @@ bool ScDPCache::InitFromDataBase (const Reference<sdbc::XRowSet>& xRowSet, const
// Now get the data rows.
Reference<sdbc::XRow> xRow(xRowSet, UNO_QUERY_THROW);
- xRowSet->first();
- ScDPItemData aData;
- do
+
+ std::vector<Bucket> aBuckets;
+ 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;
getItemValue(aData, xRow, aColTypes[nCol], nCol+1, rNullDate, nFormatType);
- SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
- sal_uLong nNumFormat = pFormatter ? pFormatter->GetStandardFormat(nFormatType) : 0;
- AddData(nCol, aData, nNumFormat);
+ 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;
+ }
}
+ while (xRowSet->next());
+
+ processBuckets(aBuckets, rField);
}
- while (xRowSet->next());
xRowSet->beforeFirst();