diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-05-27 01:42:46 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-05-27 01:45:34 +0200 |
commit | 911186d98f06b43d4563b401244e2cc216b76f33 (patch) | |
tree | 50523a9c0334dc3f38a71f2fcc5569f8c07e7588 /sc | |
parent | 8046f0b66ea1b02a91976023c7050e2570e97274 (diff) |
remove chart listener when chart is deleted, fdo#64639
Change-Id: I7ebf75f49c89edcb0bba3a597ba24ac1c0a655ef
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/chartlis.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/chartlis.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chartuno.cxx | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx index df3c02231422..ded1f3cb79ac 100644 --- a/sc/inc/chartlis.hxx +++ b/sc/inc/chartlis.hxx @@ -171,6 +171,8 @@ public: const ScChartListener* findByName(const 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 ed0796073726..df584d485d1d 100644 --- a/sc/source/core/tool/chartlis.cxx +++ b/sc/source/core/tool/chartlis.cxx @@ -469,6 +469,11 @@ void ScChartListenerCollection::insert(ScChartListener* pListener) maListeners.insert(aName, pListener); } +void ScChartListenerCollection::removeByName(const OUString& rName) +{ + maListeners.erase(rName); +} + ScChartListener* ScChartListenerCollection::findByName(const 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 5ac0daeaf8e4..0db6aace6216 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -300,6 +300,7 @@ void SAL_CALL ScChartsObj::removeByName( const 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 |