diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-12-19 08:45:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-12-19 16:49:23 +0000 |
commit | b7a0900a265ae0d21ad04b03f26ea34c725ba152 (patch) | |
tree | 880810debebcda66b23ad3e630eb931d3b1228be /ucb | |
parent | ef503472251127d32a349f1647a83aad9ba04a78 (diff) |
loplugin:implinheritancehelper in ucb
use more ImplInheritanceHelper to reduce boilerplate
Change-Id: I3ecc79ac5a1ae7a005845a7f1460e3b5037e6d53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144442
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchyprovider.cxx | 38 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchyprovider.hxx | 15 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_provider.cxx | 38 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_provider.hxx | 20 |
4 files changed, 9 insertions, 102 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx index 09ac0a2e7245..ad019732a86a 100644 --- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx @@ -49,7 +49,7 @@ using namespace hierarchy_ucp; HierarchyContentProvider::HierarchyContentProvider( const uno::Reference< uno::XComponentContext >& rxContext ) -: ::ucbhelper::ContentProviderImplHelper( rxContext ) +: HierarchyContentProvider_Base( rxContext ) { } @@ -59,42 +59,6 @@ HierarchyContentProvider::~HierarchyContentProvider() { } - -// XInterface methods. - -void SAL_CALL HierarchyContentProvider::acquire() - noexcept -{ - OWeakObject::acquire(); -} - -void SAL_CALL HierarchyContentProvider::release() - noexcept -{ - OWeakObject::release(); -} - -css::uno::Any SAL_CALL HierarchyContentProvider::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::XInitialization* >(this) - ); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); -} - -// XTypeProvider methods. - - -XTYPEPROVIDER_IMPL_4( HierarchyContentProvider, - lang::XTypeProvider, - lang::XServiceInfo, - ucb::XContentProvider, - lang::XInitialization ); - - // XServiceInfo methods. OUString SAL_CALL HierarchyContentProvider::getImplementationName() \ diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx index cbd2911d4ad0..27367e32f335 100644 --- a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx +++ b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx @@ -61,8 +61,8 @@ typedef std::unordered_map > ConfigProviderMap; -class HierarchyContentProvider : public ::ucbhelper::ContentProviderImplHelper, - public css::lang::XInitialization +typedef cppu::ImplInheritanceHelper< ::ucbhelper::ContentProviderImplHelper, css::lang::XInitialization> HierarchyContentProvider_Base; +class HierarchyContentProvider : public HierarchyContentProvider_Base { ConfigProviderMap m_aConfigProviderMap; css::uno::Reference< css::util::XOfficeInstallationDirectories > m_xOfficeInstDirs; @@ -72,17 +72,6 @@ public: const css::uno::Reference< css::uno::XComponentContext >& rxContext ); virtual ~HierarchyContentProvider() 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; diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index c5d120be076f..5e036e0d76c4 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -49,7 +49,7 @@ using namespace tdoc_ucp; ContentProvider::ContentProvider( const uno::Reference< uno::XComponentContext >& rxContext ) -: ::ucbhelper::ContentProviderImplHelper( rxContext ), +: ContentProvider_Base( rxContext ), m_xDocsMgr( new OfficeDocumentsManager( rxContext, this ) ), m_xStgElemFac( new StorageElementFactory( rxContext, m_xDocsMgr ) ) { @@ -64,42 +64,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< frame::XTransientDocumentsDocumentContentIdentifierFactory* >(this), - static_cast< frame::XTransientDocumentsDocumentContentFactory* >(this) - ); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); -} - -// XTypeProvider methods. - - -XTYPEPROVIDER_IMPL_5( ContentProvider, - lang::XTypeProvider, - lang::XServiceInfo, - ucb::XContentProvider, - frame::XTransientDocumentsDocumentContentIdentifierFactory, - frame::XTransientDocumentsDocumentContentFactory ); - - // XServiceInfo methods. OUString SAL_CALL ContentProvider::getImplementationName() { diff --git a/ucb/source/ucp/tdoc/tdoc_provider.hxx b/ucb/source/ucp/tdoc/tdoc_provider.hxx index a1f93db5ecc4..1eae1409fec2 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.hxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.hxx @@ -58,26 +58,16 @@ inline constexpr OUStringLiteral TDOC_STREAM_CONTENT_TYPE = class StorageElementFactory; -class ContentProvider - : public ::ucbhelper::ContentProviderImplHelper - , public css::frame::XTransientDocumentsDocumentContentIdentifierFactory - , public css::frame::XTransientDocumentsDocumentContentFactory +typedef cppu::ImplInheritanceHelper< + ::ucbhelper::ContentProviderImplHelper, + css::frame::XTransientDocumentsDocumentContentIdentifierFactory, + css::frame::XTransientDocumentsDocumentContentFactory > ContentProvider_Base; +class ContentProvider : public ContentProvider_Base { public: explicit ContentProvider( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); 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; |