sc/source/ui/docshell/dbdocfun.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit f6cba0dbb3819cf2e11f72bc0cdb10d5d90721de
Author: Kohei Yoshida <kohei.yosh...@gmail.com>
Date:   Wed Mar 14 11:27:17 2012 -0400

    We need to manually clear the table data in presence of group fields.
    
    There was a hack that did this in ScDPObject, which I removed.  But we
    still need to do the same except this time it's outside of ScDPObject.

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 2881e1d..c1464b1 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1460,6 +1460,11 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
     if (!pDPs)
         return 0;
 
+    bool bHasGroups = false;
+    ScDPSaveData* pSaveData = pDPObj->GetSaveData();
+    if (pSaveData && pSaveData->GetExistingDimensionData())
+        bHasGroups = true;
+
     std::set<ScDPObject*> aRefs;
     sal_uLong nErrId = pDPs->ReloadCache(pDPObj, aRefs);
     if (nErrId)
@@ -1469,6 +1474,10 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
     for (; it != itEnd; ++it)
     {
         ScDPObject* pObj = *it;
+        if (bHasGroups)
+            // Re-build table data for each pivot table when the original 
contains group fields.
+            pObj->ClearTableData();
+
         // This action is intentionally not undoable since it modifies cache.
         DataPilotUpdate(pObj, pObj, false, bApi);
     }
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to