sd/source/ui/framework/module/ToolBarModule.cxx | 10 +++++----- sd/source/ui/framework/module/ToolBarModule.hxx | 12 +++++------- sd/source/ui/framework/module/ViewTabBarModule.cxx | 12 ++++++------ sd/source/ui/framework/module/ViewTabBarModule.hxx | 10 ++++------ 4 files changed, 20 insertions(+), 24 deletions(-)
New commits: commit e833a526ba141eb7f9524f173525b177c29266c0 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Dec 28 20:06:54 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Dec 29 07:13:29 2021 +0100 use comphelper::WeakComponentImplHelper in ViewTabBarModule Change-Id: Ie3c5f2f868cf68f2701c3cbd4bf0091894c901d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/framework/module/ViewTabBarModule.cxx b/sd/source/ui/framework/module/ViewTabBarModule.cxx index b62eba9996f9..3ee872bc84a0 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.cxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.cxx @@ -48,8 +48,7 @@ namespace sd::framework { ViewTabBarModule::ViewTabBarModule ( const Reference<frame::XController>& rxController, const Reference<XResourceId>& rxViewTabBarId) - : ViewTabBarModuleInterfaceBase(m_aMutex), - mxViewTabBarId(rxViewTabBarId) + : mxViewTabBarId(rxViewTabBarId) { Reference<XControllerManager> xControllerManager (rxController, UNO_QUERY); @@ -80,12 +79,13 @@ ViewTabBarModule::~ViewTabBarModule() { } -void SAL_CALL ViewTabBarModule::disposing() +void ViewTabBarModule::disposing(std::unique_lock<std::mutex>&) { if (mxConfigurationController.is()) + { mxConfigurationController->removeConfigurationChangeListener(this); - - mxConfigurationController = nullptr; + mxConfigurationController = nullptr; + } } void SAL_CALL ViewTabBarModule::notifyConfigurationChange ( @@ -130,7 +130,7 @@ void SAL_CALL ViewTabBarModule::disposing ( { // Without the configuration controller this class can do nothing. mxConfigurationController = nullptr; - disposing(); + dispose(); } } diff --git a/sd/source/ui/framework/module/ViewTabBarModule.hxx b/sd/source/ui/framework/module/ViewTabBarModule.hxx index 2975294cea44..bfb252b8d4ff 100644 --- a/sd/source/ui/framework/module/ViewTabBarModule.hxx +++ b/sd/source/ui/framework/module/ViewTabBarModule.hxx @@ -20,8 +20,7 @@ #pragma once #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XTabBar; } @@ -29,7 +28,7 @@ namespace com::sun::star::frame { class XController; } namespace sd::framework { -typedef ::cppu::WeakComponentImplHelper < +typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XConfigurationChangeListener > ViewTabBarModuleInterfaceBase; @@ -37,8 +36,7 @@ typedef ::cppu::WeakComponentImplHelper < the center pane. */ class ViewTabBarModule - : private cppu::BaseMutex, - public ViewTabBarModuleInterfaceBase + : public ViewTabBarModuleInterfaceBase { public: /** Create a new module that controls the view tab bar above the view @@ -55,7 +53,7 @@ public: css::drawing::framework::XResourceId>& rxViewTabBarId); virtual ~ViewTabBarModule() override; - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; // XConfigurationChangeListener commit 7d01e69a91250c321eb10c133684adaedf28c439 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Dec 28 20:08:57 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Dec 29 07:13:17 2021 +0100 use comphelper::WeakComponentImplHelper in ToolBarModule Change-Id: I98caacf7ea4d994d81927e9dba6e4d46f0057f3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127658 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/framework/module/ToolBarModule.cxx b/sd/source/ui/framework/module/ToolBarModule.cxx index e513439128f0..352417b33f71 100644 --- a/sd/source/ui/framework/module/ToolBarModule.cxx +++ b/sd/source/ui/framework/module/ToolBarModule.cxx @@ -42,8 +42,7 @@ namespace sd::framework { ToolBarModule::ToolBarModule ( const Reference<frame::XController>& rxController) - : ToolBarModuleInterfaceBase(m_aMutex), - mpBase(nullptr), + : mpBase(nullptr), mbMainViewSwitchUpdatePending(false) { // Tunnel through the controller to obtain a ViewShellBase. @@ -81,12 +80,13 @@ ToolBarModule::~ToolBarModule() { } -void SAL_CALL ToolBarModule::disposing() +void ToolBarModule::disposing(std::unique_lock<std::mutex>&) { if (mxConfigurationController.is()) + { mxConfigurationController->removeConfigurationChangeListener(this); - - mxConfigurationController = nullptr; + mxConfigurationController = nullptr; + } } void SAL_CALL ToolBarModule::notifyConfigurationChange ( diff --git a/sd/source/ui/framework/module/ToolBarModule.hxx b/sd/source/ui/framework/module/ToolBarModule.hxx index cb1b22ca3979..f9189657de04 100644 --- a/sd/source/ui/framework/module/ToolBarModule.hxx +++ b/sd/source/ui/framework/module/ToolBarModule.hxx @@ -21,8 +21,7 @@ #include <ToolBarManager.hxx> #include <com/sun/star/drawing/framework/XConfigurationChangeListener.hpp> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <o3tl/deleter.hxx> #include <memory> @@ -35,16 +34,15 @@ class ViewShellBase; namespace sd::framework { -typedef ::cppu::WeakComponentImplHelper < +typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XConfigurationChangeListener > ToolBarModuleInterfaceBase; /** This module is responsible for locking the ToolBarManager during configuration updates and for triggering ToolBarManager updates. */ -class ToolBarModule - : private ::cppu::BaseMutex, - public ToolBarModuleInterfaceBase +class ToolBarModule final + : public ToolBarModuleInterfaceBase { public: /** Create a new module. @@ -55,7 +53,7 @@ public: const css::uno::Reference<css::frame::XController>& rxController); virtual ~ToolBarModule() override; - virtual void SAL_CALL disposing() override; + virtual void disposing(std::unique_lock<std::mutex>&) override; // XConfigurationChangeListener