[Libreoffice-commits] core.git: 2 commits - include/toolkit toolkit/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 7 19:31:39 UTC 2019


 include/toolkit/awt/vclxdevice.hxx |   20 +++++---------------
 include/toolkit/awt/vclxfont.hxx   |   19 +++++--------------
 toolkit/source/awt/vclxdevice.cxx  |   25 -------------------------
 toolkit/source/awt/vclxfont.cxx    |   25 -------------------------
 4 files changed, 10 insertions(+), 79 deletions(-)

New commits:
commit be634d021229408bf9e30b4cb75be5debf9a3ffd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Oct 7 14:25:14 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 7 21:30:44 2019 +0200

    use cppu::WeakImplHelper in VCLXDevice
    
    Change-Id: Ia83cc372d53db41edc8199077db91cb7b1d06e24
    Reviewed-on: https://gerrit.libreoffice.org/80386
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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(  )
 {
commit 7a3509b153246a7018748d83c9fef552544eab2b
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Oct 7 14:27:30 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 7 21:30:32 2019 +0200

    use cppu::WeakImplHelper in VCLXFont
    
    Change-Id: Iab0ff79ba1f94f087b57faefa3945aba1ed42448
    Reviewed-on: https://gerrit.libreoffice.org/80387
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx
index 921da596009e..e21936f20c99 100644
--- a/include/toolkit/awt/vclxfont.hxx
+++ b/include/toolkit/awt/vclxfont.hxx
@@ -26,7 +26,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/font.hxx>
 
@@ -38,10 +38,10 @@ class FontMetric;
 //  class VCLXFont
 
 
-class TOOLKIT_DLLPUBLIC VCLXFont final : public css::awt::XFont2,
-                    public css::lang::XTypeProvider,
-                    public css::lang::XUnoTunnel,
-                    public ::cppu::OWeakObject
+class TOOLKIT_DLLPUBLIC VCLXFont final :
+                        public cppu::WeakImplHelper<
+                            css::awt::XFont2,
+                            css::lang::XUnoTunnel>
 {
     ::osl::Mutex    maMutex;
     css::uno::Reference< css::awt::XDevice> mxDevice;
@@ -59,18 +59,9 @@ public:
     void            Init( css::awt::XDevice& rxDev, const vcl::Font& rFont );
     const vcl::Font&     GetFont() const { return maFont; }
 
-    // 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(VCLXFont)
 
-    // css::lang::XTypeProvider
-    css::uno::Sequence< css::uno::Type >  SAL_CALL getTypes() override;
-    css::uno::Sequence< sal_Int8 >                     SAL_CALL getImplementationId() override;
-
     // css::lang::XFont
     css::awt::FontDescriptor           SAL_CALL getFontDescriptor(  ) override;
     css::awt::SimpleFontMetric         SAL_CALL getFontMetric(  ) override;
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx
index 057a3c610c8b..534732c121f7 100644
--- a/toolkit/source/awt/vclxfont.cxx
+++ b/toolkit/source/awt/vclxfont.cxx
@@ -65,34 +65,9 @@ bool VCLXFont::ImplAssertValidFontMetric()
     return mpFontMetric != nullptr;
 }
 
-
-// css::uno::XInterface
-css::uno::Any VCLXFont::queryInterface( const css::uno::Type & rType )
-{
-    css::uno::Any aRet = ::cppu::queryInterface( rType,
-                                        static_cast< css::awt::XFont* >(this),
-                                        static_cast< css::awt::XFont2* >(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( VCLXFont );
 
-IMPL_IMPLEMENTATION_ID( VCLXFont )
-
-// css::lang::XTypeProvider
-css::uno::Sequence< css::uno::Type > VCLXFont::getTypes()
-{
-    static const css::uno::Sequence< css::uno::Type > aTypeList {
-        cppu::UnoType<css::lang::XTypeProvider>::get(),
-        cppu::UnoType<css::awt::XFont2>::get()
-    };
-    return aTypeList;
-}
-
-
 css::awt::FontDescriptor VCLXFont::getFontDescriptor(  )
 {
     ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );


More information about the Libreoffice-commits mailing list