summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-24 20:58:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-25 19:34:05 +0100
commitd4257daba1155ebccbfebea99bad0e4152ca9b08 (patch)
treede234db817ce25b7196bde62339d9b76da24dd7e /framework
parent98dbe250d7d5e3ebe626e8c8650e7fdccd399869 (diff)
use comphelper::WeakComponentImplHelper in MenuBarManager
Change-Id: I687f71c5af810618b3ab27b004bf765b53d7b8e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127466 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/uielement/menubarmanager.hxx9
-rw-r--r--framework/source/uielement/menubarmanager.cxx15
2 files changed, 11 insertions, 13 deletions
diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index a77552a67213..079d127d4d83 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -41,8 +41,8 @@
#include <rtl/ustring.hxx>
#include <vcl/menu.hxx>
#include <vcl/timer.hxx>
-#include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
+#include <cppuhelper/weakref.hxx>
#include <framework/addonsoptions.hxx>
namespace framework
@@ -56,8 +56,7 @@ struct PopupControllerEntry
typedef std::unordered_map< OUString, PopupControllerEntry > PopupControllerCache;
class MenuBarManager final :
- protected cppu::BaseMutex,
- public cppu::WeakComponentImplHelper<
+ public comphelper::WeakComponentImplHelper<
css::frame::XStatusListener,
css::frame::XFrameActionListener,
css::ui::XUIConfigurationListener,
@@ -121,7 +120,7 @@ class MenuBarManager final :
DECL_LINK( Deactivate, Menu *, bool );
DECL_LINK( AsyncSettingsHdl, Timer *, void );
- void SAL_CALL disposing() override;
+ void disposing(std::unique_lock<std::mutex>&) override;
void RemoveListener();
void RequestImages();
void RetrieveImageManagers();
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 08998a4b8fe8..7b856a01d43d 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -87,8 +87,7 @@ MenuBarManager::MenuBarManager(
const Reference< XDispatchProvider >& rDispatchProvider,
const OUString& rModuleIdentifier,
Menu* pMenu, bool bDelete, bool bHasMenuBar ):
- WeakComponentImplHelper( m_aMutex )
- , m_bRetrieveImages( false )
+ m_bRetrieveImages( false )
, m_bAcceleratorCfg( false )
, m_bHasMenuBar( bHasMenuBar )
, m_xContext(rxContext)
@@ -104,7 +103,7 @@ Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< sal_Int8 >& /*Proces
{
SolarMutexGuard aSolarGuard;
- if ( rBHelper.bDisposed || rBHelper.bInDispose )
+ if ( m_bDisposed )
throw css::lang::DisposedException();
Any a;
@@ -141,7 +140,7 @@ void MenuBarManager::Destroy()
{
SolarMutexGuard aGuard;
- if ( rBHelper.bDisposed )
+ if ( m_bDisposed )
return;
// stop asynchronous settings timer and
@@ -159,7 +158,7 @@ void MenuBarManager::Destroy()
}
// XComponent
-void SAL_CALL MenuBarManager::disposing()
+void MenuBarManager::disposing(std::unique_lock<std::mutex>& )
{
Reference< XComponent > xThis( this );
@@ -202,7 +201,7 @@ void SAL_CALL MenuBarManager::elementInserted( const css::ui::ConfigurationEvent
SolarMutexGuard g;
/* SAFE AREA ----------------------------------------------------------------------------------------------- */
- if ( rBHelper.bDisposed || rBHelper.bInDispose )
+ if ( m_bDisposed )
return;
sal_Int16 nImageType = sal_Int16();
@@ -225,7 +224,7 @@ void SAL_CALL MenuBarManager::frameAction( const FrameActionEvent& Action )
{
SolarMutexGuard g;
- if ( rBHelper.bDisposed || rBHelper.bInDispose )
+ if ( m_bDisposed )
throw css::lang::DisposedException();
if ( Action.Action != FrameAction_CONTEXT_CHANGED )
@@ -253,7 +252,7 @@ void SAL_CALL MenuBarManager::statusChanged( const FeatureStateEvent& Event )
SolarMutexGuard aSolarGuard;
{
- if ( rBHelper.bDisposed || rBHelper.bInDispose )
+ if ( m_bDisposed )
return;
// We have to check all menu entries as there can be identical entries in a popup menu.