dbaccess/source/ui/querydesign/limitboxcontroller.cxx |   23 ------
 dbaccess/source/ui/querydesign/limitboxcontroller.hxx |    9 --
 framework/inc/uielement/menubarwrapper.hxx            |   11 ---
 framework/source/uielement/menubarwrapper.cxx         |   64 ------------------
 4 files changed, 6 insertions(+), 101 deletions(-)

New commits:
commit 6fd64a87add9958b603b6851e0d477c4f596c22f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Dec 14 16:13:09 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Dec 14 16:25:04 2022 +0000

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

diff --git a/framework/inc/uielement/menubarwrapper.hxx 
b/framework/inc/uielement/menubarwrapper.hxx
index d696ec6c3f38..c764ecdf14b8 100644
--- a/framework/inc/uielement/menubarwrapper.hxx
+++ b/framework/inc/uielement/menubarwrapper.hxx
@@ -28,21 +28,14 @@
 namespace framework
 {
 
-class MenuBarWrapper final : public UIConfigElementWrapperBase,
-                       public css::container::XNameAccess
+typedef cppu::ImplInheritanceHelper< UIConfigElementWrapperBase, 
css::container::XNameAccess> MenuBarWrapper_Base;
+class MenuBarWrapper final : public MenuBarWrapper_Base
 
 {
     public:
         MenuBarWrapper( css::uno::Reference< css::uno::XComponentContext > 
xContext );
         virtual ~MenuBarWrapper() override;
 
-        //  XInterface, XTypeProvider
-        virtual css::uno::Any  SAL_CALL queryInterface( const css::uno::Type& 
aType ) override;
-        virtual void SAL_CALL acquire() noexcept override;
-        virtual void SAL_CALL release() noexcept override;
-        virtual css::uno::Sequence< css::uno::Type >  SAL_CALL getTypes() 
override;
-        virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
-
         MenuBarManager* GetMenuBarManager() const { return static_cast< 
MenuBarManager* >( m_xMenuBarManager.get() ); }
 
         // XComponent
diff --git a/framework/source/uielement/menubarwrapper.cxx 
b/framework/source/uielement/menubarwrapper.cxx
index 3bbd71ed785e..c1ac0025d55e 100644
--- a/framework/source/uielement/menubarwrapper.cxx
+++ b/framework/source/uielement/menubarwrapper.cxx
@@ -45,72 +45,10 @@ using namespace ::com::sun::star::ui;
 namespace framework
 {
 
-void SAL_CALL MenuBarWrapper::acquire() noexcept                               
                                           \
-{                                                                              
                                                                         \
-    /* Don't use mutex in methods of XInterface! */                            
                                                                         \
-    UIConfigElementWrapperBase::acquire();                                     
                                                                                
          \
-}                                                                              
                                                                         \
-                                                                               
                                                                         \
-void SAL_CALL MenuBarWrapper::release() noexcept                               
                                           \
-{                                                                              
                                                                         \
-    /* Don't use mutex in methods of XInterface! */                            
                                                                         \
-    UIConfigElementWrapperBase::release();                                     
                                                                                
          \
-}
-
-css::uno::Any SAL_CALL MenuBarWrapper::queryInterface( const css::uno::Type& 
aType )
-{
-    /* Attention: Don't use mutex or guard in this method!!! Is a method of 
XInterface. */
-    /* Ask for my own supported interfaces ...                                 
         */
-    css::uno::Any aReturn  = ::cppu::queryInterface( aType,
-                        static_cast< css::lang::XTypeProvider* >( this ),
-                        static_cast< css::ui::XUIElement* >( this ),
-                        static_cast< css::ui::XUIElementSettings* >( this ),
-                        static_cast< css::beans::XMultiPropertySet* >( this ),
-                        static_cast< css::beans::XFastPropertySet* >( this ),
-                        static_cast< css::beans::XPropertySet* >( this ),
-                        static_cast< css::lang::XInitialization* >( this ),
-                        static_cast< css::lang::XComponent* >( this ),
-                        static_cast< css::util::XUpdatable* >( this ),
-                        static_cast< css::ui::XUIConfigurationListener* >( 
this ),
-                        static_cast< css::container::XNameAccess* >( 
static_cast< css::container::XElementAccess* >( this ) )
-                                        );
-    /* If searched interface not supported by this class ... */
-    if ( !aReturn.hasValue() )
-    {
-        /* ... ask baseclass for interfaces! */
-        aReturn = UIConfigElementWrapperBase::queryInterface( aType );
-    }
-    /* Return result of this search. */
-    return aReturn;
-}
-
-css::uno::Sequence< sal_Int8 > SAL_CALL MenuBarWrapper::getImplementationId()
-{
-    return css::uno::Sequence<sal_Int8>();
-}
-
-css::uno::Sequence< css::uno::Type > SAL_CALL MenuBarWrapper::getTypes()
-{
-    /* Attention: "TYPES" will expand to "(...)"!   */
-    static cppu::OTypeCollection ourTypeCollection {
-                        cppu::UnoType<css::lang::XTypeProvider>::get()         
  ,
-                        cppu::UnoType<css::ui::XUIElement>::get()              
  ,
-                        cppu::UnoType<css::ui::XUIElementSettings>::get()      
  ,
-                        cppu::UnoType<css::beans::XMultiPropertySet>::get()    
  ,
-                        cppu::UnoType<css::beans::XFastPropertySet>::get()     
  ,
-                        cppu::UnoType<css::beans::XPropertySet>::get()         
  ,
-                        cppu::UnoType<css::lang::XInitialization>::get()       
  ,
-                        cppu::UnoType<css::lang::XComponent>::get()            
  ,
-                        cppu::UnoType<css::util::XUpdatable>::get()            
  ,
-                        
cppu::UnoType<css::ui::XUIConfigurationListener>::get()  ,
-                    cppu::UnoType<css::container::XNameAccess>::get() };
-    return ourTypeCollection.getTypes();
-}
-
 MenuBarWrapper::MenuBarWrapper(
     css::uno::Reference< css::uno::XComponentContext > xContext
     )
-:    UIConfigElementWrapperBase( UIElementType::MENUBAR ),
+:    MenuBarWrapper_Base( UIElementType::MENUBAR ),
      m_bRefreshPopupControllerCache( true ),
      m_xContext(std::move( xContext ))
 {
commit c43a4b0ffd96caaba64b228b059ee5c26049f399
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Dec 14 15:28:51 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Dec 14 16:24:54 2022 +0000

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

diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx 
b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
index 8b6884338063..37624aceb419 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
@@ -174,7 +174,7 @@ IMPL_LINK_NOARG(LimitBox, ActivateHdl, weld::ComboBox&, 
bool)
 
 LimitBoxController::LimitBoxController(
     const uno::Reference< uno::XComponentContext >& rxContext ) :
-    svt::ToolboxController( rxContext,
+    LimitBoxController_Base( rxContext,
                             uno::Reference< frame::XFrame >(),
                             ".uno:DBLimit" ),
     m_xLimitBox( nullptr )
@@ -185,27 +185,6 @@ LimitBoxController::~LimitBoxController()
 {
 }
 
-/// XInterface
-uno::Any SAL_CALL LimitBoxController::queryInterface( const uno::Type& aType )
-{
-    uno::Any a = ToolboxController::queryInterface( aType );
-    if ( a.hasValue() )
-        return a;
-
-    return ::cppu::queryInterface( aType, static_cast< lang::XServiceInfo* >( 
this ));
-}
-
-void SAL_CALL LimitBoxController::acquire() noexcept
-{
-    ToolboxController::acquire();
-}
-
-void SAL_CALL LimitBoxController::release() noexcept
-{
-    ToolboxController::release();
-}
-
-
 /// XServiceInfo
 OUString SAL_CALL LimitBoxController::getImplementationName()
 {
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx 
b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
index af1e5a666882..142280937235 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
@@ -24,19 +24,14 @@ class LimitBox;
  * It is communicating with querycontroller and this channel make enable
  * to set\get the value of limitbox when switching between views
  */
-class LimitBoxController: public svt::ToolboxController,
-                          public css::lang::XServiceInfo
+typedef cppu::ImplInheritanceHelper< ::svt::ToolboxController, 
css::lang::XServiceInfo> LimitBoxController_Base;
+class LimitBoxController: public LimitBoxController_Base
 {
     public:
         explicit LimitBoxController(
             const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
         virtual ~LimitBoxController() override;
 
-        /// XInterface
-        virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& 
aType ) override;
-        virtual void SAL_CALL acquire() noexcept override;
-        virtual void SAL_CALL release() noexcept override;
-
         /// XServiceInfo
         DECLARE_SERVICE_INFO();
 

Reply via email to