diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-25 20:18:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-26 16:59:50 +0200 |
commit | 2dd7c6a441f48a23dcbff1ebe24bdf21666c4ff0 (patch) | |
tree | 1d5ac3014dacdef10933c632764f0e99070c69d1 /sfx2 | |
parent | a65cba8e5bafb183924c1a8ff34382c99f1381cc (diff) |
tdf#133094 NotebookbarToolBox is not in the sidebar
though it is inheriting from SidebarToolBox and we're distinguish the sidebar
case from the non-sidebar case wrt certain color toolbuttons
Change-Id: Ieffe45adfab95d426bb36296ee3428b6bd3dbd3f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94806
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sidebar/ControllerFactory.hxx | 7 | ||||
-rw-r--r-- | sfx2/source/notebookbar/NotebookbarTabControl.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/sidebar/ControllerFactory.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/sidebar/PanelTitleBar.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarToolBox.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/toolbox/weldutils.cxx | 6 |
6 files changed, 22 insertions, 16 deletions
diff --git a/sfx2/inc/sidebar/ControllerFactory.hxx b/sfx2/inc/sidebar/ControllerFactory.hxx index 116458443abc..dbf609775a39 100644 --- a/sfx2/inc/sidebar/ControllerFactory.hxx +++ b/sfx2/inc/sidebar/ControllerFactory.hxx @@ -47,13 +47,14 @@ public: const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XController>& rxController, const css::uno::Reference<css::awt::XWindow>& rxParentWindow, - const sal_Int32 nItemWidth); + const sal_Int32 nItemWidth, bool bSideBar); static css::uno::Reference<css::frame::XToolbarController> CreateToolBoxController( weld::Toolbar& rToolbar, weld::Builder& rBuilder, const OUString& rsCommandName, - const css::uno::Reference<css::frame::XFrame>& rxFrame); + const css::uno::Reference<css::frame::XFrame>& rxFrame, + bool bSideBar); private: static css::uno::Reference<css::frame::XToolbarController> CreateToolBarController( @@ -61,7 +62,7 @@ private: const OUString& rsCommandName, const css::uno::Reference<css::frame::XFrame>& rxFrame, const css::uno::Reference<css::frame::XController>& rxController, - const sal_Int32 nWidth); + const sal_Int32 nWidth, bool bSideBar); }; diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx index 9199106de58b..79f0cd7ef67c 100644 --- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx +++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx @@ -126,6 +126,7 @@ public: : sfx2::sidebar::SidebarToolBox( pParent ) { mbUseDefaultButtonSize = false; + mbSideBar = false; SetToolboxButtonSize(ToolBoxButtonSize::Small); } diff --git a/sfx2/source/sidebar/ControllerFactory.cxx b/sfx2/source/sidebar/ControllerFactory.cxx index 71d5a3649007..50ba57a00b1f 100644 --- a/sfx2/source/sidebar/ControllerFactory.cxx +++ b/sfx2/source/sidebar/ControllerFactory.cxx @@ -44,14 +44,14 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController( const Reference<frame::XFrame>& rxFrame, const Reference<frame::XController>& rxController, const Reference<awt::XWindow>& rxParentWindow, - const sal_Int32 nWidth) + const sal_Int32 nWidth, bool bSideBar) { Reference<frame::XToolbarController> xController ( CreateToolBarController( VCLUnoHelper::GetInterface(pToolBox), rsCommandName, rxFrame, rxController, - nWidth)); + nWidth, bSideBar)); bool bFactoryHasController( xController.is() ); @@ -141,7 +141,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController( Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController( weld::Toolbar& rToolbar, weld::Builder& rBuilder, const OUString& rsCommandName, - const Reference<frame::XFrame>& rxFrame) + const Reference<frame::XFrame>& rxFrame, bool bSideBar) { css::uno::Reference<css::awt::XWindow> xWidget(new weld::TransportAsXWindow(&rToolbar, &rBuilder)); @@ -150,7 +150,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController( xWidget, rsCommandName, rxFrame, rxFrame->getController(), - -1)); + -1, bSideBar)); if (!xController.is()) { @@ -204,7 +204,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController( const OUString& rsCommandName, const Reference<frame::XFrame>& rxFrame, const Reference<frame::XController>& rxController, - const sal_Int32 nWidth) + const sal_Int32 nWidth, bool bSideBar) { try { @@ -234,7 +234,7 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBarController( aPropertyVector.push_back( makeAny( aPropValue )); aPropValue.Name = "IsSidebar"; - aPropValue.Value <<= true; + aPropValue.Value <<= bSideBar; aPropertyVector.push_back( makeAny( aPropValue )); if (nWidth > 0) diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx index 21c423fcc34e..e8613f6f93d3 100644 --- a/sfx2/source/sidebar/PanelTitleBar.cxx +++ b/sfx2/source/sidebar/PanelTitleBar.cxx @@ -93,7 +93,7 @@ void PanelTitleBar::SetMoreOptionsCommand(const OUString& rsCommandName, msMoreOptionsCommand, rxFrame, rxController, VCLUnoHelper::GetInterface(maToolBox.get()), - 0)); + 0, true)); maToolBox->SetController(mnMenuItemIndex, xController); maToolBox->SetOutStyle(TOOLBOX_STYLE_FLAT); maToolBox->SetQuickHelpText( diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx index ca3d076fb414..f77e6d5ff260 100644 --- a/sfx2/source/sidebar/SidebarToolBox.cxx +++ b/sfx2/source/sidebar/SidebarToolBox.cxx @@ -58,7 +58,8 @@ namespace sfx2::sidebar { SidebarToolBox::SidebarToolBox (vcl::Window* pParentWindow) : ToolBox(pParentWindow, 0), mbAreHandlersRegistered(false), - mbUseDefaultButtonSize(true) + mbUseDefaultButtonSize(true), + mbSideBar(true) { SetBackground(Wallpaper()); SetPaintTransparent(true); @@ -121,7 +122,7 @@ void SidebarToolBox::InsertItem(const OUString& rCommand, ToolBox::InsertItem(aCommand, rFrame, nBits, rRequestedSize, nPos); - CreateController(GetItemId(aCommand), rFrame, std::max(rRequestedSize.Width(), 0L)); + CreateController(GetItemId(aCommand), rFrame, std::max(rRequestedSize.Width(), 0L), mbSideBar); RegisterHandlers(); } @@ -149,13 +150,13 @@ void SidebarToolBox::KeyInput(const KeyEvent& rKEvt) void SidebarToolBox::CreateController ( const sal_uInt16 nItemId, const css::uno::Reference<css::frame::XFrame>& rxFrame, - const sal_Int32 nItemWidth) + const sal_Int32 nItemWidth, bool bSideBar) { const OUString sCommandName (GetItemCommand(nItemId)); uno::Reference<frame::XToolbarController> xController(sfx2::sidebar::ControllerFactory::CreateToolBoxController( this, nItemId, sCommandName, rxFrame, rxFrame->getController(), - VCLUnoHelper::GetInterface(this), nItemWidth)); + VCLUnoHelper::GetInterface(this), nItemWidth, bSideBar)); if (xController.is()) maControllers.insert(std::make_pair(nItemId, xController)); @@ -315,6 +316,7 @@ public: explicit NotebookbarToolBox(vcl::Window* pParentWindow) : SidebarToolBox(pParentWindow) { + mbSideBar = false; SetToolboxButtonSize(GetDefaultButtonSize()); } diff --git a/sfx2/source/toolbox/weldutils.cxx b/sfx2/source/toolbox/weldutils.cxx index c35f9047cf20..fc97aefa404a 100644 --- a/sfx2/source/toolbox/weldutils.cxx +++ b/sfx2/source/toolbox/weldutils.cxx @@ -72,10 +72,12 @@ vcl::ImageType ToolbarUnoDispatcher::GetIconSize() const } ToolbarUnoDispatcher::ToolbarUnoDispatcher(weld::Toolbar& rToolbar, weld::Builder& rBuilder, - const css::uno::Reference<css::frame::XFrame>& rFrame) + const css::uno::Reference<css::frame::XFrame>& rFrame, + bool bSideBar) : m_xFrame(rFrame) , m_pToolbar(&rToolbar) , m_pBuilder(&rBuilder) + , m_bSideBar(bSideBar) { rToolbar.connect_clicked(LINK(this, ToolbarUnoDispatcher, SelectHdl)); rToolbar.connect_menu_toggled(LINK(this, ToolbarUnoDispatcher, ToggleMenuHdl)); @@ -114,7 +116,7 @@ void ToolbarUnoDispatcher::CreateController(const OUString& rCommand) { css::uno::Reference<css::frame::XToolbarController> xController( sfx2::sidebar::ControllerFactory::CreateToolBoxController(*m_pToolbar, *m_pBuilder, - rCommand, m_xFrame)); + rCommand, m_xFrame, m_bSideBar)); if (xController.is()) maControllers.insert(std::make_pair(rCommand, xController)); |