From 2845df5b6a3fc598fa59f972b6ce281b36177736 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Wed, 10 Mar 2021 16:20:07 +0100 Subject: Extend ToolBarManager to build weld::Toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - used for SubToolBarController eg. framework shape toolbar popup present in the sidebar fontwork panel - add separate implementation for vcl and weld based ToolBarManager - provide basic functionality for weld based (just inserting standard items with icons and controllers) - not implemented: addons items merging etc. Change-Id: I8e460f34abd512d70e95a1d484d728b7d809ce9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113387 Tested-by: Jenkins Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114411 Tested-by: Jenkins CollaboraOffice --- sfx2/source/appl/app.cxx | 12 ++++++++++++ sfx2/source/toolbox/tbxitem.cxx | 1 + 2 files changed, 13 insertions(+) (limited to 'sfx2') diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index ed0596250056..b1433520ca97 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -96,6 +97,16 @@ SfxModule* SfxApplication::GetModule(SfxToolsModule nSharedLib) return g_pSfxApplication->pImpl->aModules[nSharedLib].get(); } +namespace { + css::uno::Reference SfxWeldToolBoxControllerFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, weld::Toolbar* pToolbar, weld::Builder* pBuilder, const OUString& aCommandURL ) + { + SolarMutexGuard aGuard; + + return sfx2::sidebar::ControllerFactory::CreateToolBoxController( + *pToolbar, *pBuilder, aCommandURL, rFrame, rFrame->getController(), false); + } +} + SfxApplication* SfxApplication::GetOrCreate() { // SFX on demand @@ -113,6 +124,7 @@ SfxApplication* SfxApplication::GetOrCreate() ::framework::SetRefreshToolbars( RefreshToolbars ); ::framework::SetToolBoxControllerCreator( SfxToolBoxControllerFactory ); + ::framework::SetWeldToolBoxControllerCreator( SfxWeldToolBoxControllerFactory ); ::framework::SetStatusBarControllerCreator( SfxStatusBarControllerFactory ); ::framework::SetDockingWindowCreator( SfxDockingWindowFactory ); ::framework::SetIsDockingWindowVisible( IsDockingWindowVisible ); diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 1240100e9daa..99ae9ff3e7e5 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -56,6 +56,7 @@ #include #include #include +#include #include #include -- cgit