summaryrefslogtreecommitdiff
path: root/sc/source/core/data/dptablecache.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/dptablecache.cxx')
-rw-r--r--sc/source/core/data/dptablecache.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index 4ce51952d578..57f6ce18cda1 100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -37,6 +37,7 @@
#include "queryparam.hxx"
#include "dpglobal.hxx"
#include "dptabdat.hxx"
+#include "dpobject.hxx"
#include "docoptio.hxx"
#include <unotools/textsearch.hxx>
@@ -993,6 +994,8 @@ void ScDPCache::AddReference(ScDPObject* pObj) const
void ScDPCache::RemoveReference(ScDPObject* pObj) const
{
maRefObjects.erase(pObj);
+ if (maRefObjects.empty())
+ mpDoc->GetDPCollection()->RemoveCache(this);
}
const ScDPCache::ObjectSetType& ScDPCache::GetAllReferences() const