diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-28 13:55:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-28 18:55:14 +0100 |
commit | f1561065dd2178088925f45f64e6fc4cdfe72c4c (patch) | |
tree | e24b1ff3d13e30c1cc7d529a99aa58e7d9961fce | |
parent | 39e4c9c228ec7998334cffc8c451b2d6c6063b0a (diff) |
use comphelper::WeakComponentImplHelper in PresenterPreviewCache
Change-Id: I23537d6050a4055c1d06b227722a6f6991f245cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127635
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sd/source/ui/presenter/PresenterPreviewCache.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/presenter/PresenterPreviewCache.hxx | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx index 4a3e64501152..fd29cdbfac1b 100644 --- a/sd/source/ui/presenter/PresenterPreviewCache.cxx +++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx @@ -25,6 +25,7 @@ #include <sdpage.hxx> #include <cppcanvas/vclfactory.hxx> #include <com/sun/star/drawing/XDrawPage.hpp> +#include <osl/diagnose.h> namespace com::sun::star::uno { class XComponentContext; } @@ -72,8 +73,7 @@ private: //===== PresenterPreviewCache ================================================= PresenterPreviewCache::PresenterPreviewCache () - : PresenterPreviewCacheInterfaceBase(m_aMutex), - maPreviewSize(Size(200,200)), + : maPreviewSize(Size(200,200)), mpCacheContext(std::make_shared<PresenterCacheContext>()), mpCache(std::make_shared<PageCache>(maPreviewSize, Bitmap::HasFastScale(), mpCacheContext)) { @@ -149,7 +149,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview ( void SAL_CALL PresenterPreviewCache::addPreviewCreationNotifyListener ( const Reference<drawing::XSlidePreviewCacheListener>& rxListener) { - if (rBHelper.bDisposed || rBHelper.bInDispose) + if (m_bDisposed) return; if (rxListener.is()) mpCacheContext->AddPreviewCreationNotifyListener(rxListener); @@ -178,7 +178,7 @@ void SAL_CALL PresenterPreviewCache::resume() void PresenterPreviewCache::ThrowIfDisposed() { - if (rBHelper.bDisposed || rBHelper.bInDispose) + if (m_bDisposed) { throw lang::DisposedException ("PresenterPreviewCache object has already been disposed", static_cast<uno::XWeak*>(this)); diff --git a/sd/source/ui/presenter/PresenterPreviewCache.hxx b/sd/source/ui/presenter/PresenterPreviewCache.hxx index 710fb81635ec..4f8c522804c3 100644 --- a/sd/source/ui/presenter/PresenterPreviewCache.hxx +++ b/sd/source/ui/presenter/PresenterPreviewCache.hxx @@ -22,24 +22,22 @@ #include <com/sun/star/drawing/XSlidePreviewCache.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <tools/gen.hxx> -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/basemutex.hxx> +#include <comphelper/compbase.hxx> #include <memory> namespace sd::slidesorter::cache { class PageCache; } namespace sd::presenter { -typedef ::cppu::WeakComponentImplHelper< +typedef comphelper::WeakComponentImplHelper< css::lang::XInitialization, css::drawing::XSlidePreviewCache > PresenterPreviewCacheInterfaceBase; /** Uno API wrapper around the slide preview cache. */ -class PresenterPreviewCache - : private ::cppu::BaseMutex, - public PresenterPreviewCacheInterfaceBase +class PresenterPreviewCache final + : public PresenterPreviewCacheInterfaceBase { public: PresenterPreviewCache (); |