From be634d021229408bf9e30b4cb75be5debf9a3ffd Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 7 Oct 2019 14:25:14 +0200 Subject: use cppu::WeakImplHelper in VCLXDevice Change-Id: Ia83cc372d53db41edc8199077db91cb7b1d06e24 Reviewed-on: https://gerrit.libreoffice.org/80386 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/toolkit/awt/vclxdevice.hxx | 20 +++++--------------- toolkit/source/awt/vclxdevice.cxx | 25 ------------------------- 2 files changed, 5 insertions(+), 40 deletions(-) diff --git a/include/toolkit/awt/vclxdevice.hxx b/include/toolkit/awt/vclxdevice.hxx index b99b5bce6b7f..07cd499cacfb 100644 --- a/include/toolkit/awt/vclxdevice.hxx +++ b/include/toolkit/awt/vclxdevice.hxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -33,11 +33,10 @@ /// A UNO wrapper for the VCL OutputDevice class TOOLKIT_DLLPUBLIC VCLXDevice : - public css::awt::XDevice, - public css::lang::XTypeProvider, - public css::lang::XUnoTunnel, - public css::awt::XUnitConversion, - public ::cppu::OWeakObject + public cppu::WeakImplHelper< + css::awt::XDevice, + css::lang::XUnoTunnel, + css::awt::XUnitConversion> { friend class VCLXGraphics; friend class VCLXVirtualDevice; @@ -52,18 +51,9 @@ public: void SetOutputDevice( const VclPtr &pOutDev ) { mpOutputDevice = pOutDev; } const VclPtr& GetOutputDevice() const { return mpOutputDevice; } - // css::uno::XInterface - css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - void SAL_CALL acquire() throw() override { OWeakObject::acquire(); } - void SAL_CALL release() throw() override { OWeakObject::release(); } - // css::lang::XUnoTunnel UNO3_GETIMPLEMENTATION_DECL(VCLXDevice) - // css::lang::XTypeProvider - css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - // css::awt::XDevice, css::uno::Reference< css::awt::XGraphics > SAL_CALL createGraphics( ) override; css::uno::Reference< css::awt::XDevice > SAL_CALL createDevice( sal_Int32 nWidth, sal_Int32 nHeight ) override; diff --git a/toolkit/source/awt/vclxdevice.cxx b/toolkit/source/awt/vclxdevice.cxx index 2cd53e927b54..73dba634e9ff 100644 --- a/toolkit/source/awt/vclxdevice.cxx +++ b/toolkit/source/awt/vclxdevice.cxx @@ -50,34 +50,9 @@ VCLXDevice::~VCLXDevice() mpOutputDevice.reset(); } -// css::uno::XInterface -css::uno::Any VCLXDevice::queryInterface( const css::uno::Type & rType ) -{ - css::uno::Any aRet = ::cppu::queryInterface( rType, - static_cast< css::awt::XDevice* >(this), - static_cast< css::lang::XUnoTunnel* >(this), - static_cast< css::lang::XTypeProvider* >(this), - static_cast< css::awt::XUnitConversion* >(this) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); -} - // css::lang::XUnoTunnel UNO3_GETIMPLEMENTATION_IMPL( VCLXDevice ); -IMPL_IMPLEMENTATION_ID( VCLXDevice ) - -// css::lang::XTypeProvider -css::uno::Sequence< css::uno::Type > VCLXDevice::getTypes() -{ - static const css::uno::Sequence< css::uno::Type > aTypeList { - cppu::UnoType::get(), - cppu::UnoType::get(), - cppu::UnoType::get() - }; - return aTypeList; -} - - // css::awt::XDevice, css::uno::Reference< css::awt::XGraphics > VCLXDevice::createGraphics( ) { -- cgit