diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-07 14:25:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-07 21:30:44 +0200 |
commit | be634d021229408bf9e30b4cb75be5debf9a3ffd (patch) | |
tree | 7de205b0fead6e05d7ec71cb5ed5b575703bd2e4 | |
parent | 7a3509b153246a7018748d83c9fef552544eab2b (diff) |
use cppu::WeakImplHelper in VCLXDevice
Change-Id: Ia83cc372d53db41edc8199077db91cb7b1d06e24
Reviewed-on: https://gerrit.libreoffice.org/80386
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/toolkit/awt/vclxdevice.hxx | 20 | ||||
-rw-r--r-- | 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 <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <comphelper/servicehelper.hxx> -#include <cppuhelper/weak.hxx> +#include <cppuhelper/implbase.hxx> #include <vcl/virdev.hxx> #include <vcl/vclptr.hxx> @@ -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<OutputDevice> &pOutDev ) { mpOutputDevice = pOutDev; } const VclPtr<OutputDevice>& 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<css::lang::XTypeProvider>::get(), - cppu::UnoType<css::awt::XDevice>::get(), - cppu::UnoType<css::awt::XUnitConversion>::get() - }; - return aTypeList; -} - - // css::awt::XDevice, css::uno::Reference< css::awt::XGraphics > VCLXDevice::createGraphics( ) { |