sc/inc/chartlis.hxx | 2 ++ sc/source/core/tool/chartlis.cxx | 5 +++++ sc/source/ui/unoobj/chartuno.cxx | 1 + 3 files changed, 8 insertions(+)
New commits: commit c96c6d52cf382cfbc3e2e16619a6e3370fb1a40b Author: Markus Mohrhard <[email protected]> Date: Mon May 27 01:42:46 2013 +0200 remove chart listener when chart is deleted, fdo#64639 Change-Id: I7ebf75f49c89edcb0bba3a597ba24ac1c0a655ef diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx index df3c022..ded1f3c 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 ed07960..df584d4 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 b31200b..c259aaa 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 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 _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
