summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-07-05 11:17:19 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-05 11:19:52 -0400
commitfa2b7eff2d40b6455970b521306c5961e4e3cec4 (patch)
treeb6867782e1eef0e00d791ebd5f700e904567c9ea /sc/inc
parent40faf88cf0bef76e653e7e9dab707b4c936e7a3e (diff)
fdo#51266: Sync dimension members in several places upon refresh.
Or else the pivot table would generate erroneous results or crash after refresh. Change-Id: Ia14a6e3d25112e6ecd62d21928639f75e6a8ba7c
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/dpcachetable.hxx6
-rw-r--r--sc/inc/dpgroup.hxx1
-rw-r--r--sc/inc/dpobject.hxx6
-rw-r--r--sc/inc/dpsave.hxx5
-rw-r--r--sc/inc/dpsdbtab.hxx1
-rw-r--r--sc/inc/dpshttab.hxx1
-rw-r--r--sc/inc/dptabdat.hxx1
7 files changed, 21 insertions, 0 deletions
diff --git a/sc/inc/dpcachetable.hxx b/sc/inc/dpcachetable.hxx
index f104d3b200ba..d83491089d16 100644
--- a/sc/inc/dpcachetable.hxx
+++ b/sc/inc/dpcachetable.hxx
@@ -56,6 +56,12 @@ class ScRange;
struct ScDPValueData;
struct ScQueryParam;
+/**
+ * Despite the name, this class is only a wrapper to the actual cache, to
+ * provide filtering on the raw data based on the query filter and/or page
+ * field filters. I will rename this class to a more appropriate name in the
+ * future.
+ */
class SC_DLLPUBLIC ScDPCacheTable
{
struct RowFlag
diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index 4bf9972f7b29..5d48af06231e 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -182,6 +182,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
virtual const ScDPCacheTable& GetCacheTable() const;
+ virtual void ClearCacheTable();
virtual sal_Bool IsBaseForGroup(long nDim) const;
virtual long GetGroupBase(long nGroupDim) const;
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index da0fc0943da8..e163ef1cb82c 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -239,6 +239,12 @@ public:
void BuildAllDimensionMembers();
+ /**
+ * Remove in the save data entries for members that don't exist anymore.
+ * This is called during pivot table refresh.
+ */
+ void SyncAllDimensionMembers();
+
static bool HasRegisteredSources();
static com::sun::star::uno::Sequence<rtl::OUString> GetRegisteredSources();
static com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index c4df4eda7b76..28bfafdbe1f4 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -33,6 +33,7 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
#include <boost/scoped_ptr.hpp>
#include <com/sun/star/sheet/XDimensionsSupplier.hpp>
@@ -122,6 +123,7 @@ private:
::com::sun::star::sheet::DataPilotFieldLayoutInfo* pLayoutInfo; // (level)
public:
+ typedef boost::unordered_set<rtl::OUString, rtl::OUStringHash> MemberSetType;
typedef boost::unordered_map <rtl::OUString, ScDPSaveMember*, rtl::OUStringHash> MemberHash;
typedef std::list <ScDPSaveMember*> MemberList;
@@ -230,6 +232,8 @@ public:
void UpdateMemberVisibility(const ::boost::unordered_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData);
bool HasInvisibleMember() const;
+
+ void RemoveObsoleteMembers(const MemberSetType& rMembers);
};
@@ -344,6 +348,7 @@ public:
SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there
void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied
void BuildAllDimensionMembers(ScDPTableData* pData);
+ void SyncAllDimensionMembers(ScDPTableData* pData);
/**
* Check whether a dimension has one or more invisible members.
diff --git a/sc/inc/dpsdbtab.hxx b/sc/inc/dpsdbtab.hxx
index eba6da20d52d..a96b0115014b 100644
--- a/sc/inc/dpsdbtab.hxx
+++ b/sc/inc/dpsdbtab.hxx
@@ -88,6 +88,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
virtual const ScDPCacheTable& GetCacheTable() const;
+ virtual void ClearCacheTable();
};
diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx
index 3a0fcb3e94f1..510105d36723 100644
--- a/sc/inc/dpshttab.hxx
+++ b/sc/inc/dpshttab.hxx
@@ -128,6 +128,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData);
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow);
virtual const ScDPCacheTable& GetCacheTable() const;
+ virtual void ClearCacheTable();
};
diff --git a/sc/inc/dptabdat.hxx b/sc/inc/dptabdat.hxx
index 1bbc4d6c70cc..f19a6ba7a0a4 100644
--- a/sc/inc/dptabdat.hxx
+++ b/sc/inc/dptabdat.hxx
@@ -154,6 +154,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& rData) = 0;
virtual void CalcResults(CalcInfo& rInfo, bool bAutoShow) = 0;
virtual const ScDPCacheTable& GetCacheTable() const = 0;
+ virtual void ClearCacheTable() = 0;
// overloaded in ScDPGroupTableData:
virtual sal_Bool IsBaseForGroup(long nDim) const;