diff options
-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); } |