[Libreoffice-commits] .: 2 commits - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 22 11:58:51 PDT 2012


 sc/source/core/data/dpcache.cxx    |    9 ++++++---
 sc/source/ui/docshell/dbdocfun.cxx |    6 ------
 2 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 88979ef6ffe7921200311513d6601f9c5d582a42
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Aug 22 14:55:34 2012 -0400

    Don't clear the database data cache here.
    
    This would result in the pivot cache being refreshed twice.  This block
    of code was a leftover from the previous, non-cached version of pivot
    table, and this logic no longer applies today.
    
    In today's pivot table code, the cache gets refreshed first, then the
    table gets refreshed afterward.  We should never clear the cache data
    during table refresh.
    
    Change-Id: Ida6fa1805463facf842cb9ea94f4c1afab716595

diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index ffcc59e..c5ac760 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1324,12 +1324,6 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
             }
             if ( pDestObj )
             {
-                // create new database connection for "refresh"
-                // (and re-read column entry collections)
-                // so all changes take effect
-                if ( pNewObj == pOldObj && pDestObj->IsImportData() )
-                    pDestObj->ClearTableData();
-
                 pDestObj->ReloadGroupTableData();
                 pDestObj->InvalidateData();             // before getting the new output area
 
commit f4ed9a5adbea3de88870ff4f5cb202bd606e0746
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Aug 22 14:25:01 2012 -0400

    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

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index d04adf1..ff8fc6e 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());
 


More information about the Libreoffice-commits mailing list