summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-27 01:42:46 +0200
committerNoel Power <noel.power@suse.com>2013-05-27 13:43:46 +0000
commit231707c7ae06ca6dcfc1a8d62472d8a1e18a2b73 (patch)
treed3a321a010e06f6c8ed4a1760c3c068fb195b581
parente2cbb5eea18c419a162f5c18fe5df617cd57db27 (diff)
remove chart listener when chart is deleted, fdo#64639
Change-Id: I7ebf75f49c89edcb0bba3a597ba24ac1c0a655ef Reviewed-on: https://gerrit.libreoffice.org/4046 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
-rw-r--r--sc/inc/chartlis.hxx2
-rw-r--r--sc/source/core/tool/chartlis.cxx5
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx1
3 files changed, 8 insertions, 0 deletions
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 8ca27603b527..791efef6e3d7 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -181,6 +181,8 @@ public:
const ScChartListener* findByName(const rtl::OUString& rName) const;
bool hasListeners() const;
+ void removeByName(const OUString& rName);
+
const ListenersType& getListeners() const;
ListenersType& getListeners();
StringSetType& getNonOleObjectNames();
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index d49fdebc089b..55239a01249f 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -486,6 +486,11 @@ void ScChartListenerCollection::insert(ScChartListener* pListener)
maListeners.insert(aName, pListener);
}
+void ScChartListenerCollection::removeByName(const rtl::OUString& rName)
+{
+ maListeners.erase(rName);
+}
+
ScChartListener* ScChartListenerCollection::findByName(const rtl::OUString& rName)
{
ListenersType::iterator it = maListeners.find(rName);
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 4996586f3910..71bc893a86af 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -309,6 +309,7 @@ void SAL_CALL ScChartsObj::removeByName( const rtl::OUString& aName )
if (pObj)
{
ScDocument* pDoc = pDocShell->GetDocument();
+ pDoc->GetChartListenerCollection()->removeByName(aName);
ScDrawLayer* pModel = pDoc->GetDrawLayer(); // ist nicht 0
SdrPage* pPage = pModel->GetPage(static_cast<sal_uInt16>(nTab)); // ist nicht 0