include/toolkit/awt/vclxgraphics.hxx | 18 ++++-------------- toolkit/source/awt/vclxgraphics.cxx | 23 ----------------------- 2 files changed, 4 insertions(+), 37 deletions(-)
New commits: commit 09e0e415e1fe1821a2ee5b12dab9b20fd7c46641 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Oct 7 14:29:16 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Oct 7 22:02:32 2019 +0200 use cppu::WeakImplHelper in VCLXGraphics Change-Id: If862818ef3eb534493ac61d5071ec1adf590ebf2 Reviewed-on: https://gerrit.libreoffice.org/80388 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx index 1482bad16b3e..85464ae37e56 100644 --- a/include/toolkit/awt/vclxgraphics.hxx +++ b/include/toolkit/awt/vclxgraphics.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/font.hxx> #include <tools/color.hxx> @@ -54,10 +54,9 @@ namespace o3tl // class VCLXGraphics -class VCLXGraphics : public css::awt::XGraphics2, - public css::lang::XTypeProvider, - public css::lang::XUnoTunnel, - public ::cppu::OWeakObject +class VCLXGraphics : public cppu::WeakImplHelper< + css::awt::XGraphics2, + css::lang::XUnoTunnel> { private: // used to return same reference on each call to getDevice() @@ -84,18 +83,9 @@ public: void SetOutputDevice( OutputDevice* pOutDev ); 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(VCLXGraphics) - // css::lang::XTypeProvider - css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - // css::awt::XGraphics Attributes virtual css::uno::Reference< css::awt::XDevice > SAL_CALL getDevice() override; virtual void SAL_CALL setTextColor( ::sal_Int32 _textcolor ) override; diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index c5a27d244538..12f586a9a454 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -37,32 +37,9 @@ using namespace com::sun::star; // class VCLXGraphics - -// uno::XInterface -uno::Any VCLXGraphics::queryInterface( const uno::Type & rType ) -{ - uno::Any aRet = ::cppu::queryInterface( rType, - static_cast< css::awt::XGraphics* >(this), - static_cast< css::lang::XTypeProvider* >(this), - static_cast< css::lang::XUnoTunnel* >(this) ); - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); -} - // lang::XUnoTunnel UNO3_GETIMPLEMENTATION_IMPL( VCLXGraphics ); -IMPL_IMPLEMENTATION_ID( VCLXGraphics ) - -// lang::XTypeProvider -css::uno::Sequence< css::uno::Type > VCLXGraphics::getTypes() -{ - static const css::uno::Sequence< css::uno::Type > aTypeList { - cppu::UnoType<css::lang::XTypeProvider>::get(), - cppu::UnoType<awt::XGraphics>::get() - }; - return aTypeList; -} - VCLXGraphics::VCLXGraphics() : mpOutputDevice(nullptr) , meRasterOp(RasterOp::OverPaint) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits