summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-07 14:27:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-07 21:30:32 +0200
commit7a3509b153246a7018748d83c9fef552544eab2b (patch)
tree118159784dbf67ad3b5505dfe32844ba893149b3
parent9429864a3fce4dae1e6d9387a1747a338768f316 (diff)
use cppu::WeakImplHelper in VCLXFont
Change-Id: Iab0ff79ba1f94f087b57faefa3945aba1ed42448 Reviewed-on: https://gerrit.libreoffice.org/80387 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/toolkit/awt/vclxfont.hxx19
-rw-r--r--toolkit/source/awt/vclxfont.cxx25
2 files changed, 5 insertions, 39 deletions
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() );