Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4045

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/45/4045/1

remove chart listener when chart is deleted, fdo#64639

Change-Id: I7ebf75f49c89edcb0bba3a597ba24ac1c0a655ef
---
M sc/inc/chartlis.hxx
M sc/source/core/tool/chartlis.cxx
M sc/source/ui/unoobj/chartuno.cxx
3 files changed, 8 insertions(+), 0 deletions(-)



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 @@
     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 @@
     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 @@
     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
 

-- 
To view, visit https://gerrit.libreoffice.org/4045
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ebf75f49c89edcb0bba3a597ba24ac1c0a655ef
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Markus Mohrhard <markus.mohrhard@googlemail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.