summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-27 14:32:33 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-27 14:32:33 +0100
commit1683fae27e9019731534190964491b88b68b7a6e (patch)
tree3ffc321bcb73aa99ce9687a0dd1cc6122467a5fa
parentb100342d42a15a3aed79d6f23ecfd0b56e4a86bf (diff)
Use WeakImplHelper to implement MenuBarManager
Change-Id: I3a30bc86796a7ad24616cb11ae10b6886e09c1e9
-rw-r--r--framework/inc/uielement/menubarmanager.hxx20
-rw-r--r--framework/source/uielement/menubarmanager.cxx33
2 files changed, 10 insertions, 43 deletions
diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index 040bb06d625e..7c363dc902e1 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 989943e8a13e..26bf92edd808 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;