[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/inc sc/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon May 27 06:42:08 PDT 2013
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 92dc9cb50d2d7ebff6fb591d265589ef5f22dc1b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon May 27 01:42:46 2013 +0200
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 at suse.com>
Tested-by: Noel Power <noel.power at suse.com>
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 788c326..e32a1f0 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 67da747..712c60a404 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 8072f3b..092ddce 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
More information about the Libreoffice-commits
mailing list