summaryrefslogtreecommitdiffstats
path: root/framework/inc
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-02-05 10:51:28 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2017-02-06 23:05:17 +0000
commit486c3101519c9fc3c85c206020e780e54f646482 (patch)
tree8e697295d9f1c3a304d043a2c776e3451ab5f2a2 /framework/inc
parentSilence "Invalid SlotId" warnings (diff)
downloadcore-486c3101519c9fc3c85c206020e780e54f646482.tar.gz
core-486c3101519c9fc3c85c206020e780e54f646482.zip
MenuToolbarController improvements
- Make it self-contained, instead of having its code spread across ToolBarManager. - Base it on svt::ToolboxController directly, since it uses nothing from GenericToolbarController. - Move the code from dtor to dispose method. - Call ToolBox::SetItemDown to make the button work on a second click. Change-Id: I5b38ef532ba40ef0ac31bc53de5b6be4ccd1a118 Reviewed-on: https://gerrit.libreoffice.org/33982 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework/inc')
-rw-r--r--framework/inc/uielement/generictoolbarcontroller.hxx21
-rw-r--r--framework/inc/uielement/toolbarmanager.hxx6
2 files changed, 8 insertions, 19 deletions
diff --git a/framework/inc/uielement/generictoolbarcontroller.hxx b/framework/inc/uielement/generictoolbarcontroller.hxx
index 88aa79832c11..c2711f1efc8c 100644
--- a/framework/inc/uielement/generictoolbarcontroller.hxx
+++ b/framework/inc/uielement/generictoolbarcontroller.hxx
@@ -67,26 +67,21 @@ class GenericToolbarController : public svt::ToolboxController
OUString m_aEnumCommand;
};
-class MenuToolbarController : public GenericToolbarController
+class MenuToolbarController : public svt::ToolboxController
{
css::uno::Reference< css::container::XIndexAccess > m_xMenuDesc;
VclPtr<PopupMenu> pMenu;
css::uno::Reference< css::lang::XComponent > m_xMenuManager;
- OUString m_aModuleIdentifier;
- public:
- MenuToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
- const css::uno::Reference< css::frame::XFrame >& rFrame,
- ToolBox* pToolBar,
- sal_uInt16 nID,
- const OUString& aCommand,
- const OUString& aModuleIdentifier,
- const css::uno::Reference< css::container::XIndexAccess >& xMenuDesc );
- virtual ~MenuToolbarController() override;
+public:
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& ) override {}
+ // XComponent
+ virtual void SAL_CALL dispose() override;
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArgs ) override;
// XToolbarController
- virtual void SAL_CALL click() override;
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override;
-
};
}
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 1ecbdfa293d2..739d22f5647a 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -37,7 +37,6 @@
#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/ui/XImageManager.hpp>
-#include <com/sun/star/ui/XUIConfigurationManager.hpp>
#include <com/sun/star/ui/ItemStyle.hpp>
#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -153,8 +152,6 @@ class ToolBarManager : public ToolbarManager_Base
typedef ::std::vector< css::uno::Reference< css::frame::XSubToolbarController > > SubToolBarControllerVector;
typedef std::unordered_map<OUString, SubToolBarControllerVector, OUStringHash> SubToolBarToSubToolBarControllerMap;
- typedef std::unordered_map< sal_uInt16, css::uno::Reference< css::container::XIndexAccess > > MenuDescriptionMap;
-
bool m_bDisposed : 1,
m_bAddedToTaskPaneList : 1,
m_bFrameActionRegistered : 1,
@@ -176,14 +173,11 @@ class ToolBarManager : public ToolbarManager_Base
css::uno::Reference< css::frame::XUIControllerFactory > m_xToolbarControllerFactory;
css::uno::Reference< css::ui::XImageManager > m_xModuleImageManager;
css::uno::Reference< css::ui::XImageManager > m_xDocImageManager;
- css::uno::Reference< css::ui::XUIConfigurationManager > m_xUICfgMgr;
- css::uno::Reference< css::ui::XUIConfigurationManager > m_xDocUICfgMgr;
CommandToInfoMap m_aCommandMap;
SubToolBarToSubToolBarControllerMap m_aSubToolBarControllerMap;
Timer m_aAsyncUpdateControllersTimer;
OUString m_sIconTheme;
- MenuDescriptionMap m_aMenuMap;
};
}