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

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Jul 5 13:14:04 PDT 2012


 sc/source/core/data/dpcache.cxx |   22 +++++++++++++++++++++-
 sc/source/core/data/dpsave.cxx  |    1 -
 2 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 6747dd33754a15e7d9f5aae01bb8299b6a05e365
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Jul 5 16:08:36 2012 -0400

    Use correct row indices to keep track of empty rows.
    
    In pivot table cache, data rows are always zero-based, and are
    different from the rows of cells from which the data are pulled.
    
    This error resulted in incorrect pivot table result when the "skip
    empty rows" option was set.
    
    Change-Id: I4fccb37a8667f7e40d6130ac641d7b2a1daa7694

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 9163dde..d04adf1 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -412,7 +412,7 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange)
 
             if (!aData.IsEmpty())
             {
-                maEmptyRows.insert_back(nRow, nRow+1, false);
+                maEmptyRows.insert_back(i, i+1, false);
                 rField.mnNumFormat = nNumFormat;
             }
         }
@@ -1212,6 +1212,26 @@ void ScDPCache::Dump() const
     }
 
     {
+        struct { SCROW start; SCROW end; bool empty; } aRange;
+        cout << "* empty rows: " << endl;
+        mdds::flat_segment_tree<SCROW, bool>::const_iterator it = maEmptyRows.begin(), itEnd = maEmptyRows.end();
+        if (it != itEnd)
+        {
+            aRange.start = it->first;
+            aRange.empty = it->second;
+            ++it;
+        }
+
+        for (; it != itEnd; ++it)
+        {
+            aRange.end = it->first-1;
+            cout << "    rows " << aRange.start << "-" << aRange.end << ": " << (aRange.empty ? "empty" : "not-empty") << endl;
+            aRange.start = it->first;
+            aRange.empty = it->second;
+        }
+    }
+
+    {
         GroupFieldsType::const_iterator it = maGroupFields.begin(), itEnd = maGroupFields.end();
         for (size_t i = maFields.size(); it != itEnd; ++it, ++i)
         {
commit 46776932d8118ae0f64945a9a1ee6ff46094067e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Jul 5 14:47:46 2012 -0400

    Unnecessary header include.
    
    Change-Id: I3f25f2275d8351b16d955941bc2cee13eb34d504

diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 62bda08..5feec06 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -34,7 +34,6 @@
 #include "global.hxx"
 #include "dptabsrc.hxx"
 #include "dputil.hxx"
-#include "stlalgorithm.hxx"
 
 #include <sal/types.h>
 #include "comphelper/string.hxx"


More information about the Libreoffice-commits mailing list