summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-07 14:32:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-08 08:25:39 +0200
commitd3883e67bfe9f2889690b435bc57273c22e327f7 (patch)
tree04df6c54aecc9b1802fc10319b27a80c0ec64b7a
parente1771399490fe0d2c40fb250f03c362128916223 (diff)
use cppu::WeakImplHelper in VCLXRegion
Change-Id: I93bb52b35b4c15dc93d7638d7fc1e00652a2a1e7 Reviewed-on: https://gerrit.libreoffice.org/80400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/toolkit/awt/vclxregion.hxx18
-rw-r--r--toolkit/source/awt/vclxregion.cxx23
2 files changed, 4 insertions, 37 deletions
diff --git a/include/toolkit/awt/vclxregion.hxx b/include/toolkit/awt/vclxregion.hxx
index b91e40fd70b1..aec3e0b0af5d 100644
--- a/include/toolkit/awt/vclxregion.hxx
+++ b/include/toolkit/awt/vclxregion.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 <osl/mutex.hxx>
#include <vcl/region.hxx>
@@ -34,10 +34,9 @@
// class VCLXRegion
-class VCLXRegion final : public css::awt::XRegion,
- public css::lang::XTypeProvider,
- public css::lang::XUnoTunnel,
- public ::cppu::OWeakObject
+class VCLXRegion final : public cppu::WeakImplHelper<
+ css::awt::XRegion,
+ css::lang::XUnoTunnel>
{
::osl::Mutex maMutex;
vcl::Region maRegion;
@@ -50,18 +49,9 @@ public:
const vcl::Region& GetRegion() const { return maRegion; }
- // 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(VCLXRegion)
- // css::lang::XTypeProvider
- css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
- css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
-
// css::awt::XRegion
css::awt::Rectangle SAL_CALL getBounds() override;
void SAL_CALL clear() override;
diff --git a/toolkit/source/awt/vclxregion.cxx b/toolkit/source/awt/vclxregion.cxx
index fa24e203d0a8..93298a1893a0 100644
--- a/toolkit/source/awt/vclxregion.cxx
+++ b/toolkit/source/awt/vclxregion.cxx
@@ -34,32 +34,9 @@ VCLXRegion::~VCLXRegion()
{
}
-// css::uno::XInterface
-css::uno::Any VCLXRegion::queryInterface( const css::uno::Type & rType )
-{
- css::uno::Any aRet = ::cppu::queryInterface( rType,
- static_cast< css::awt::XRegion* >(this),
- static_cast< css::lang::XUnoTunnel* >(this),
- static_cast< css::lang::XTypeProvider* >(this) );
- return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
-}
-
// css::lang::XUnoTunnel
UNO3_GETIMPLEMENTATION_IMPL( VCLXRegion );
-IMPL_IMPLEMENTATION_ID( VCLXRegion )
-
-// css::lang::XTypeProvider
-css::uno::Sequence< css::uno::Type > VCLXRegion::getTypes()
-{
- static const css::uno::Sequence< css::uno::Type > aTypeList {
- cppu::UnoType<css::lang::XTypeProvider>::get(),
- cppu::UnoType<css::awt::XRegion>::get()
- };
- return aTypeList;
-}
-
-
css::awt::Rectangle VCLXRegion::getBounds()
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );