From 705594fc805012b5bf6167d7f9fee63bb1b90a1b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 14 Dec 2022 16:14:02 +0200 Subject: loplugin:implinheritancehelper in sw use more ImplInheritanceHelper to reduce boilerplate Change-Id: I0bf96b2e3d897d19d4883c2958c72fbfe3b61080 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144164 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx | 50 +++------------------- 1 file changed, 6 insertions(+), 44 deletions(-) (limited to 'sw/source/uibase/dbui') diff --git a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx index a97974f57f34..1603d11b2608 100644 --- a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx +++ b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx @@ -97,7 +97,8 @@ IMPL_LINK(CurrentEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool) } /// Controller for .uno:MailMergeCurrentEntry toolbar checkbox: creates the checkbox & handles the value. -class MMCurrentEntryController : public svt::ToolboxController, public lang::XServiceInfo +typedef cppu::ImplInheritanceHelper< ::svt::ToolboxController, css::lang::XServiceInfo> MMCurrentEntryController_Base; +class MMCurrentEntryController : public MMCurrentEntryController_Base { VclPtr m_xCurrentEdit; @@ -105,31 +106,11 @@ class MMCurrentEntryController : public svt::ToolboxController, public lang::XSe public: explicit MMCurrentEntryController(const uno::Reference& rContext) - : svt::ToolboxController(rContext, uno::Reference(), ".uno:MailMergeCurrentEntry") + : MMCurrentEntryController_Base(rContext, uno::Reference(), ".uno:MailMergeCurrentEntry") , m_xCurrentEdit(nullptr) { } - // XInterface - virtual uno::Any SAL_CALL queryInterface(const uno::Type& aType) override - { - uno::Any a(ToolboxController::queryInterface(aType)); - if (a.hasValue()) - return a; - - return ::cppu::queryInterface(aType, static_cast(this)); - } - - void SAL_CALL acquire() noexcept override - { - ToolboxController::acquire(); - } - - void SAL_CALL release() noexcept override - { - ToolboxController::release(); - } - // XServiceInfo virtual OUString SAL_CALL getImplementationName() override { @@ -208,7 +189,8 @@ IMPL_LINK(ExcludeCheckBox, KeyInputHdl, const KeyEvent&, rKEvt, bool) } /// Controller for .uno:MailMergeExcludeEntry toolbar checkbox: creates the checkbox & handles the value. -class MMExcludeEntryController : public svt::ToolboxController, public lang::XServiceInfo +typedef cppu::ImplInheritanceHelper< ::svt::ToolboxController, css::lang::XServiceInfo> MMExcludeEntryController_Base; +class MMExcludeEntryController : public MMExcludeEntryController_Base { VclPtr m_xExcludeCheckbox; @@ -216,31 +198,11 @@ class MMExcludeEntryController : public svt::ToolboxController, public lang::XSe public: explicit MMExcludeEntryController(const uno::Reference& rContext) - : svt::ToolboxController(rContext, uno::Reference(), ".uno:MailMergeExcludeEntry") + : MMExcludeEntryController_Base(rContext, uno::Reference(), ".uno:MailMergeExcludeEntry") , m_xExcludeCheckbox(nullptr) { } - // XInterface - virtual uno::Any SAL_CALL queryInterface(const uno::Type& aType) override - { - uno::Any a(ToolboxController::queryInterface(aType)); - if (a.hasValue()) - return a; - - return ::cppu::queryInterface(aType, static_cast(this)); - } - - void SAL_CALL acquire() noexcept override - { - ToolboxController::acquire(); - } - - void SAL_CALL release() noexcept override - { - ToolboxController::release(); - } - // XServiceInfo virtual OUString SAL_CALL getImplementationName() override { -- cgit