loplugin:implinheritancehelper in xmlhelp

use more ImplInheritanceHelper to reduce boilerplate

Change-Id: Ie8104d40dd13b02f19bcaf1806255446d17b25a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144443
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-12-19 08:46:00 +02:00
parent 5cb7fed2a5
commit 5465a60ec2
2 changed files with 3 additions and 63 deletions

View file

@ -43,7 +43,7 @@ using namespace chelp;
// ContentProvider Implementation.
ContentProvider::ContentProvider( const uno::Reference< uno::XComponentContext >& rxContext )
: ::ucbhelper::ContentProviderImplHelper( rxContext )
: ContentProvider_Base( rxContext )
, isInitialized( false )
{
}
@ -53,53 +53,6 @@ ContentProvider::~ContentProvider()
{
}
// XInterface methods.
void SAL_CALL ContentProvider::acquire()
noexcept
{
OWeakObject::acquire();
}
void SAL_CALL ContentProvider::release()
noexcept
{
OWeakObject::release();
}
css::uno::Any SAL_CALL ContentProvider::queryInterface( const css::uno::Type & rType )
{
css::uno::Any aRet = cppu::queryInterface( rType,
static_cast< lang::XTypeProvider* >(this),
static_cast< lang::XServiceInfo* >(this),
static_cast< ucb::XContentProvider* >(this),
static_cast< lang::XComponent* >(this),
static_cast< lang::XEventListener* >(this),
static_cast< container::XContainerListener* >(this)
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
// XTypeProvider methods.
css::uno::Sequence< sal_Int8 > SAL_CALL ContentProvider::getImplementationId()
{
return css::uno::Sequence<sal_Int8>();
}
css::uno::Sequence< css::uno::Type > SAL_CALL ContentProvider::getTypes()
{
static cppu::OTypeCollection ourTypeCollection(
cppu::UnoType<lang::XTypeProvider>::get(),
cppu::UnoType<lang::XServiceInfo>::get(),
cppu::UnoType<ucb::XContentProvider>::get(),
cppu::UnoType<lang::XComponent>::get(),
cppu::UnoType<container::XContainerListener>::get()
);
return ourTypeCollection.getTypes();
}
// XServiceInfo methods.
OUString SAL_CALL ContentProvider::getImplementationName()

View file

@ -39,10 +39,8 @@ inline constexpr OUStringLiteral MYUCP_CONTENT_TYPE = u"application/vnd.sun.star
class Databases;
class ContentProvider :
public ::ucbhelper::ContentProviderImplHelper,
public css::container::XContainerListener,
public css::lang::XComponent
typedef cppu::ImplInheritanceHelper< ::ucbhelper::ContentProviderImplHelper, css::container::XContainerListener, css::lang::XComponent> ContentProvider_Base;
class ContentProvider : public ContentProvider_Base
{
public:
explicit ContentProvider(
@ -50,17 +48,6 @@ inline constexpr OUStringLiteral MYUCP_CONTENT_TYPE = u"application/vnd.sun.star
virtual ~ContentProvider() override;
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
virtual void SAL_CALL acquire()
noexcept override;
virtual void SAL_CALL release()
noexcept override;
// XTypeProvider
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;