toolkit/source/hatchwindow/hatchwindow.cxx     |   41 -------------------------
 toolkit/source/hatchwindow/hatchwindow.hxx     |   13 +------
 ucb/source/ucp/hierarchy/hierarchyprovider.cxx |   38 -----------------------
 ucb/source/ucp/hierarchy/hierarchyprovider.hxx |   15 +--------
 ucb/source/ucp/tdoc/tdoc_provider.cxx          |   38 -----------------------
 ucb/source/ucp/tdoc/tdoc_provider.hxx          |   20 +++---------
 6 files changed, 11 insertions(+), 154 deletions(-)

New commits:
commit b7a0900a265ae0d21ad04b03f26ea34c725ba152
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Dec 19 08:45:44 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Dec 19 16:49:23 2022 +0000

    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.gran...@collabora.co.uk>

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;
commit ef503472251127d32a349f1647a83aad9ba04a78
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Dec 19 08:45:23 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Dec 19 16:49:13 2022 +0000

    loplugin:implinheritancehelper in toolkit
    
    use more ImplInheritanceHelper to reduce boilerplate
    
    Change-Id: I209e013f84a83339d0f4a6dfd90b462a47b6beeb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144441
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/toolkit/source/hatchwindow/hatchwindow.cxx 
b/toolkit/source/hatchwindow/hatchwindow.cxx
index 31b017d77fef..b421e13091f2 100644
--- a/toolkit/source/hatchwindow/hatchwindow.cxx
+++ b/toolkit/source/hatchwindow/hatchwindow.cxx
@@ -109,47 +109,6 @@ void VCLXHatchWindow::InplaceDeactivate()
 }
 
 
-uno::Any SAL_CALL VCLXHatchWindow::queryInterface( const uno::Type & rType )
-{
-    // Attention:
-    //    Don't use mutex or guard in this method!!! Is a method of XInterface.
-
-    uno::Any aReturn( ::cppu::queryInterface( rType,
-                                           static_cast< embed::XHatchWindow* 
>( this ) ) );
-
-    if ( aReturn.hasValue() )
-    {
-        return aReturn ;
-    }
-
-    return VCLXWindow::queryInterface( rType ) ;
-}
-
-void SAL_CALL VCLXHatchWindow::acquire()
-    noexcept
-{
-    VCLXWindow::acquire();
-}
-
-void SAL_CALL VCLXHatchWindow::release()
-    noexcept
-{
-    VCLXWindow::release();
-}
-
-uno::Sequence< uno::Type > SAL_CALL VCLXHatchWindow::getTypes()
-{
-    static cppu::OTypeCollection 
aTypeCollection(cppu::UnoType<embed::XHatchWindow>::get(),
-                                                 VCLXWindow::getTypes());
-
-    return aTypeCollection.getTypes();
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL VCLXHatchWindow::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
 css::awt::Size SAL_CALL VCLXHatchWindow::getHatchBorderSize()
 {
     return aHatchBorderSize;
diff --git a/toolkit/source/hatchwindow/hatchwindow.hxx 
b/toolkit/source/hatchwindow/hatchwindow.hxx
index 52e91d12e695..128a5198f9ab 100644
--- a/toolkit/source/hatchwindow/hatchwindow.hxx
+++ b/toolkit/source/hatchwindow/hatchwindow.hxx
@@ -24,8 +24,8 @@
 #include <toolkit/awt/vclxwindow.hxx>
 
 class SvResizeWindow;
-class VCLXHatchWindow : public css::embed::XHatchWindow,
-                        public VCLXWindow
+typedef cppu::ImplInheritanceHelper< VCLXWindow, css::embed::XHatchWindow> 
VCLXHatchWindow_Base;
+class VCLXHatchWindow : public VCLXHatchWindow_Base
 {
     css::uno::Reference< css::embed::XHatchWindowController > m_xController;
     css::awt::Size aHatchBorderSize;
@@ -45,15 +45,6 @@ public:
     void Activated();
     void Deactivated();
 
-    // XInterface
-    css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType ) 
override;
-    void SAL_CALL acquire() noexcept override;
-    void SAL_CALL release() noexcept override;
-
-    // XTypeProvider
-    css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
-    css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
-
     // XHatchWindow
     virtual void SAL_CALL setController( const css::uno::Reference< 
css::embed::XHatchWindowController >& xController ) override;
     virtual css::awt::Size SAL_CALL getHatchBorderSize() override;

Reply via email to