From 2cf9f0fe3a5da6fe53021278be88e33ad9e6e09d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 28 Dec 2021 14:55:59 +0200 Subject: use comphelper::WeakComponentImplHelper in PresenterCustomSprite Change-Id: I4d85620cc189fb918d0b52a569f8612c51a39f2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127643 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/presenter/PresenterCanvas.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/presenter/PresenterCanvas.cxx b/sd/source/ui/presenter/PresenterCanvas.cxx index 044bbefc1b03..f586969bc7b9 100644 --- a/sd/source/ui/presenter/PresenterCanvas.cxx +++ b/sd/source/ui/presenter/PresenterCanvas.cxx @@ -27,8 +27,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -43,13 +42,12 @@ namespace sd::presenter { /** Wrapper around a sprite that is displayed on a PresenterCanvas. */ namespace { - typedef ::cppu::WeakComponentImplHelper < + typedef comphelper::WeakComponentImplHelper < css::rendering::XCustomSprite > PresenterCustomSpriteInterfaceBase; -class PresenterCustomSprite - : protected ::cppu::BaseMutex, - public PresenterCustomSpriteInterfaceBase +class PresenterCustomSprite final + : public PresenterCustomSpriteInterfaceBase { public: PresenterCustomSprite ( @@ -58,7 +56,7 @@ public: const Reference& rxBaseWindow); PresenterCustomSprite(const PresenterCustomSprite&) = delete; PresenterCustomSprite& operator=(const PresenterCustomSprite&) = delete; - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock&) override; // XSprite @@ -695,15 +693,14 @@ PresenterCustomSprite::PresenterCustomSprite ( const rtl::Reference& rpCanvas, const Reference& rxSprite, const Reference& rxBaseWindow) - : PresenterCustomSpriteInterfaceBase(m_aMutex), - mpCanvas(rpCanvas), + : mpCanvas(rpCanvas), mxSprite(rxSprite), mxBaseWindow(rxBaseWindow), maPosition(0,0) { } -void SAL_CALL PresenterCustomSprite::disposing() +void PresenterCustomSprite::disposing(std::unique_lock&) { Reference xComponent (mxSprite, UNO_QUERY); mxSprite = nullptr; @@ -781,7 +778,7 @@ Reference PresenterCustomSprite::getContentCanvas() void PresenterCustomSprite::ThrowIfDisposed() { - if (rBHelper.bDisposed || rBHelper.bInDispose || ! mxSprite.is()) + if (m_bDisposed || ! mxSprite.is()) { throw lang::DisposedException ("PresenterCustomSprite object has already been disposed", static_cast(this)); -- cgit