summaryrefslogtreecommitdiff
path: root/framework/inc/uielement/menubarmanager.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/inc/uielement/menubarmanager.hxx')
-rw-r--r--framework/inc/uielement/menubarmanager.hxx34
1 files changed, 14 insertions, 20 deletions
diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx
index 9cb47eedc7d3..1beb2961e690 100644
--- a/framework/inc/uielement/menubarmanager.hxx
+++ b/framework/inc/uielement/menubarmanager.hxx
@@ -17,13 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_MENUBARMANAGER_HXX
-#define INCLUDED_FRAMEWORK_INC_UIELEMENT_MENUBARMANAGER_HXX
+#pragma once
+
+#include <sal/config.h>
-/** Attention: stl headers must(!) be included at first. Otherwise it can make trouble
- with solaris headers ...
-*/
#include <unordered_map>
+#include <utility>
#include <vector>
#include <com/sun/star/frame/XFrame.hpp>
@@ -43,8 +42,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
@@ -58,8 +57,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,
@@ -123,31 +121,29 @@ 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();
static bool MustBeHidden( PopupMenu* pPopupMenu, const css::uno::Reference< css::util::XURLTransformer >& rTransformer );
OUString RetrieveLabelFromCommand(const OUString& rCmdURL);
- void Destroy();
-
struct MenuItemHandler
{
MenuItemHandler( sal_uInt16 aItemId,
- css::uno::Reference< css::frame::XStatusListener > const & xManager,
- css::uno::Reference< css::frame::XDispatch > const & rDispatch ) :
+ rtl::Reference< MenuBarManager > xManager,
+ css::uno::Reference< css::frame::XDispatch > xDispatch ) :
nItemId( aItemId ),
bMadeInvisible ( false ),
- xSubMenuManager( xManager ),
- xMenuItemDispatch( rDispatch ) {}
+ xSubMenuManager(std::move( xManager )),
+ xMenuItemDispatch(std::move( xDispatch )) {}
sal_uInt16 nItemId;
bool bMadeInvisible;
OUString aTargetFrame;
OUString aMenuItemURL;
OUString aParsedItemURL;
- css::uno::Reference< css::frame::XStatusListener > xSubMenuManager;
+ rtl::Reference< MenuBarManager > xSubMenuManager;
css::uno::Reference< css::frame::XDispatch > xMenuItemDispatch;
css::uno::Reference< css::frame::XPopupMenuController > xPopupMenuController;
css::uno::Reference< css::awt::XPopupMenu > xPopupMenu;
@@ -166,7 +162,7 @@ class MenuBarManager final :
const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider,
const OUString& rModuleIdentifier );
void AddMenu(MenuBarManager* pSubMenuManager,const OUString& _sItemCommand,sal_uInt16 _nItemId);
- sal_uInt16 FillItemCommand(OUString& _rItemCommand, Menu* _pMenu,sal_uInt16 _nIndex) const;
+ static sal_uInt16 FillItemCommand(OUString& _rItemCommand, Menu* _pMenu,sal_uInt16 _nIndex);
void SetHdl();
bool m_bDeleteMenu;
@@ -195,6 +191,4 @@ class MenuBarManager final :
} // namespace
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */