diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-27 19:19:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-28 07:31:08 +0100 |
commit | 2d6db9bf6f1c2d5489f6de648df9e9c2e08c383e (patch) | |
tree | c008bd6048c1209c48acc38bdea0856cf18154dc | |
parent | e6c7996a53691ebf2ab32f1660aeba74bc30b9c3 (diff) |
use comphelper::WeakComponentImplHelper in sd..controller::Listener
Change-Id: Idecb4bc7bf3516464ff6bd637a5c9b3bfa06ea9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127603
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsListener.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsListener.hxx | 11 |
2 files changed, 8 insertions, 10 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx index 64399c91214d..000f42da2c38 100644 --- a/sd/source/ui/slidesorter/controller/SlsListener.cxx +++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx @@ -54,8 +54,7 @@ namespace sd::slidesorter::controller { Listener::Listener ( SlideSorter& rSlideSorter) - : ListenerInterfaceBase(m_aMutex), - mrSlideSorter(rSlideSorter), + : mrSlideSorter(rSlideSorter), mrController(mrSlideSorter.GetController()), mpBase(mrSlideSorter.GetViewShellBase()), mbListeningToDocument (false), @@ -415,7 +414,7 @@ void SAL_CALL Listener::notifyEvent ( void SAL_CALL Listener::propertyChange ( const PropertyChangeEvent& rEvent) { - if (rBHelper.bDisposed || rBHelper.bInDispose) + if (m_bDisposed) { throw lang::DisposedException ("SlideSorterController object has already been disposed", static_cast<uno::XWeak*>(this)); @@ -489,7 +488,7 @@ void SAL_CALL Listener::notifyEvent ( { } -void SAL_CALL Listener::disposing() +void Listener::disposing(std::unique_lock<std::mutex>&) { ReleaseListeners(); } diff --git a/sd/source/ui/slidesorter/controller/SlsListener.hxx b/sd/source/ui/slidesorter/controller/SlsListener.hxx index 793d554607cc..eff02cf19825 100644 --- a/sd/source/ui/slidesorter/controller/SlsListener.hxx +++ b/sd/source/ui/slidesorter/controller/SlsListener.hxx @@ -24,8 +24,8 @@ #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/accessibility/XAccessibleEventListener.hpp> #include <com/sun/star/frame/XFrameActionListener.hpp> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> +#include <cppuhelper/weakref.hxx> #include <svl/lstner.hxx> #include <tools/link.hxx> @@ -42,7 +42,7 @@ namespace sd::slidesorter { class SlideSorter; } namespace sd::slidesorter::controller { -typedef cppu::WeakComponentImplHelper< +typedef comphelper::WeakComponentImplHelper< css::document::XEventListener, css::beans::XPropertyChangeListener, css::accessibility::XAccessibleEventListener, @@ -58,8 +58,7 @@ typedef cppu::WeakComponentImplHelper< to the old controller and register as listener at the new one. */ class Listener - : protected cppu::BaseMutex, - public ListenerInterfaceBase, + : public ListenerInterfaceBase, public SfxListener { public: @@ -114,7 +113,7 @@ public: virtual void SAL_CALL frameAction (const css::frame::FrameActionEvent& rEvent) override; - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; private: SlideSorter& mrSlideSorter; |