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>
diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index a77552a..079d127 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 08998a4..7b856a0 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.