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

New commits:
commit 3988c35c9635dfc38f6a2125e5664f60f164951b
Author: Kohei Yoshida <kohei.yosh...@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 2d2a0a3..3299ba0 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 1d29c97313988b4e128030f2e7011891725c8fe7
Author: Kohei Yoshida <kohei.yosh...@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 fc289b9..5c987da 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -37,7 +37,6 @@
 #include "global.hxx"
 #include "dptabsrc.hxx"
 #include "dputil.hxx"
-#include "stlalgorithm.hxx"
 
 #include <sal/types.h>
 #include "comphelper/string.hxx"
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to