summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-08-22 14:25:01 -0400
committerCaolán McNamara <caolanm@redhat.com>2012-08-27 21:14:38 +0100
commit7ca2d95c8ee30c450483433d5f380ebbf80691d5 (patch)
treece219bab0cd8157e9ec565d5946409f4314d6b73
parent8beb667105e30b37b322fc62c8ebf923101b679f (diff)
fdo#53640: Correctly cache source data coming from database backend.libreoffice-3-6-1
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 Signed-off-by: Michael Meeks <michael.meeks@suse.com> (cherry picked from commit a28d9cad672739cbf8dc6cf1f9db7d0f8becfee1) Signed-off-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/dpcache.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 3299ba050372..a11db558b799 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -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());