diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-03-14 11:27:17 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-03-14 11:29:01 -0400 |
commit | f6cba0dbb3819cf2e11f72bc0cdb10d5d90721de (patch) | |
tree | df3ef71e453e7aa2212916dd00c64eff276a8caa /sc/source | |
parent | 5142e628b563a9876e8884c5dd4914eff4a2f307 (diff) |
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.
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 2881e1d43feb..c1464b151bee 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); } |