diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-05-27 01:42:46 +0200 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-05-27 13:41:49 +0000 |
commit | 92dc9cb50d2d7ebff6fb591d265589ef5f22dc1b (patch) | |
tree | 7b35fe314d39f3edb0906389a6e89268d7e1130e | |
parent | 6a2df328ded9771e3589c4f123ab64048279690f (diff) |
remove chart listener when chart is deleted, fdo#64639
Change-Id: I7ebf75f49c89edcb0bba3a597ba24ac1c0a655ef
Reviewed-on: https://gerrit.libreoffice.org/4045
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
-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 788c3264d962..e32a1f0b84e9 100644 --- a/sc/inc/chartlis.hxx +++ b/sc/inc/chartlis.hxx @@ -171,6 +171,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 67da7473c54d..712c60a4049a 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 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 8072f3b0d728..092ddce7dd67 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -298,6 +298,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 |