[Libreoffice-commits] core.git: framework/inc framework/source

Stephan Bergmann sbergman at redhat.com
Mon Feb 27 13:33:07 UTC 2017


 framework/inc/uielement/menubarmanager.hxx    |   20 ++++++---------
 framework/source/uielement/menubarmanager.cxx |   33 +-------------------------
 2 files changed, 10 insertions(+), 43 deletions(-)

New commits:
commit 1683fae27e9019731534190964491b88b68b7a6e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Feb 27 14:32:33 2017 +0100

    Use WeakImplHelper to implement MenuBarManager
    
    Change-Id: I3a30bc86796a7ad24616cb11ae10b6886e09c1e9

diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index 040bb06..7c363dc 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -51,7 +51,7 @@
 #include <vcl/accel.hxx>
 #include <vcl/timer.hxx>
 #include <toolkit/awt/vclxmenu.hxx>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase.hxx>
 #include <cppuhelper/weakref.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <framework/addonsoptions.hxx>
@@ -68,12 +68,13 @@ typedef std::unordered_map< OUString, PopupControllerEntry, OUStringHash > Popup
 
 class AddonMenu;
 class AddonPopupMenu;
-class MenuBarManager : public css::frame::XStatusListener                ,
-                       public css::frame::XFrameActionListener           ,
-                       public css::ui::XUIConfigurationListener          ,
-                       public css::lang::XComponent                      ,
-                       public css::awt::XSystemDependentMenuPeer         ,
-                       public ::cppu::OWeakObject
+class MenuBarManager:
+    public cppu::WeakImplHelper<
+        css::frame::XStatusListener,
+        css::frame::XFrameActionListener,
+        css::ui::XUIConfigurationListener,
+        css::lang::XComponent,
+        css::awt::XSystemDependentMenuPeer>
 {
     protected:
         MenuBarManager(
@@ -96,11 +97,6 @@ class MenuBarManager : public css::frame::XStatusListener                ,
 
         virtual ~MenuBarManager() override;
 
-        // XInterface
-        virtual void SAL_CALL acquire() throw() override;
-        virtual void SAL_CALL release() throw() override;
-        virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
-
         // XComponent
         virtual void SAL_CALL dispose() override;
         virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 989943e..26bf92e 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -126,8 +126,7 @@ MenuBarManager::MenuBarManager(
     const Reference< XDispatchProvider >& rDispatchProvider,
     const OUString& rModuleIdentifier,
     Menu* pMenu, bool bDelete, bool bHasMenuBar ):
-    OWeakObject()
-    , m_bDisposed( false )
+    m_bDisposed( false )
     , m_bRetrieveImages( false )
     , m_bAcceleratorCfg( false )
     , m_bModuleIdentified( false )
@@ -148,8 +147,7 @@ MenuBarManager::MenuBarManager(
     const Reference< XURLTransformer >& _xURLTransformer,
     Menu* pAddonMenu,
     bool popup):
-    OWeakObject()
-    , m_bDisposed( false )
+    m_bDisposed( false )
     , m_bRetrieveImages( true )
     , m_bAcceleratorCfg( false )
     , m_bModuleIdentified( false )
@@ -163,33 +161,6 @@ MenuBarManager::MenuBarManager(
     Init(rFrame,pAddonMenu, popup);
 }
 
-Any SAL_CALL MenuBarManager::queryInterface( const Type & rType )
-{
-    Any a = ::cppu::queryInterface(
-                rType ,
-                (static_cast< css::frame::XStatusListener* >(this)),
-                (static_cast< css::frame::XFrameActionListener* >(this)),
-                (static_cast< css::ui::XUIConfigurationListener* >(this)),
-                (static_cast< XEventListener* >(static_cast<XStatusListener *>(this))),
-                (static_cast< XComponent* >(this)),
-                (static_cast< css::awt::XSystemDependentMenuPeer* >(this)));
-
-    if ( a.hasValue() )
-        return a;
-
-    return OWeakObject::queryInterface( rType );
-}
-
-void SAL_CALL MenuBarManager::acquire() throw()
-{
-    OWeakObject::acquire();
-}
-
-void SAL_CALL MenuBarManager::release() throw()
-{
-    OWeakObject::release();
-}
-
 Any SAL_CALL MenuBarManager::getMenuHandle( const Sequence< sal_Int8 >& /*ProcessId*/, sal_Int16 SystemType )
 {
     SolarMutexGuard aSolarGuard;


More information about the Libreoffice-commits mailing list