diff options
author | Dimitri Bouron <bouron.d@gmail.com> | 2017-08-03 11:57:48 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-09-19 13:24:49 +0200 |
commit | bab7e8b836bbd0ab609f6f846c3fa880dcf9859c (patch) | |
tree | cd6d1d22935a549fd9882a4c65930e740667b42a /sc | |
parent | e63edbb765169da8d4aca09adfff904891cebe98 (diff) |
tdf#111305: Fix group name refresh in pivot table
Change-Id: Ibc22bfba5765aba3014651df50afb23b893d2b5a
Reviewed-on: https://gerrit.libreoffice.org/40712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 3d37e10684edf9536beefe5670b144571e6c9792)
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/dbfunc3.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index e8eccb1a62f2..304a1428d6bb 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -73,6 +73,8 @@ #include <unordered_set> #include <unordered_map> #include <vector> +#include <set> +#include <algorithm> using namespace com::sun::star; using ::com::sun::star::uno::Any; @@ -1337,6 +1339,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) pDPObj->BuildAllDimensionMembers(); ScDPSaveData aData( *pDPObj->GetSaveData() ); bool bChange = false; + bool bNeedReloadGroups = false; sal_uInt16 nOrient = DataPilotFieldOrientation_HIDDEN; long nField = pDPObj->GetHeaderDim( rPos, nOrient ); @@ -1457,6 +1460,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) pSaveMember->SetName( rString ); bChange = true; + bNeedReloadGroups = true; } else nErrorId = STR_INVALIDNAME; @@ -1575,6 +1579,16 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString ) // apply changes ScDBDocFunc aFunc( *GetViewData().GetDocShell() ); pDPObj->SetSaveData( aData ); + if (bNeedReloadGroups) + { + ScDPCollection* pDPs = pDoc->GetDPCollection(); + if (pDPs) + { + std::set<ScDPObject*> aRefs; + // tdf#111305: Reload groups in cache after modifications. + pDPs->ReloadGroupsInCache(pDPObj, aRefs); + } // pDPs + } // bNeedReloadGroups aFunc.UpdatePivotTable(*pDPObj, true, false); } else |