From af97c180983e5a8ac147b97f7773d483bba8cfef Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 11 Aug 2016 13:53:20 +0200 Subject: GSoC notebookbar: multiple .ui implementations + added menu controller for .uno:Notebookbar showing all implementations + switching between .ui files + officecfg stores implementation description + added second implementation file notebookbar_groups.ui Change-Id: I9f406daced7a111793f61a2e9f939cba27d92184 Reviewed-on: https://gerrit.libreoffice.org/28067 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt --- sd/source/ui/docshell/docshel3.cxx | 17 +++++++++++++++-- sd/source/ui/docshell/docshell.cxx | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 142e38184426..056d59b44ff0 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -320,8 +320,21 @@ void DrawDocShell::Execute( SfxRequest& rReq ) case SID_NOTEBOOKBAR: { - if (mpViewShell) - sfx2::SfxNotebookBar::ExecMethod(mpViewShell->GetFrame()->GetBindings()); + const SfxStringItem* pFile = rReq.GetArg( SID_NOTEBOOKBAR ); + + if ( mpViewShell ) + { + SfxBindings& rBindings( mpViewShell->GetFrame()->GetBindings() ); + + if ( !pFile || ( pFile && !sfx2::SfxNotebookBar::IsActive() ) ) + sfx2::SfxNotebookBar::ExecMethod( rBindings ); + else if ( pFile && pFile->GetValue().isEmpty() ) + { + sfx2::SfxNotebookBar::CloseMethod( rBindings ); + if ( sfx2::SfxNotebookBar::IsActive() ) + sfx2::SfxNotebookBar::ExecMethod( rBindings ); + } + } } break; diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 9a0698234420..fc54b20373bc 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -274,7 +274,7 @@ void DrawDocShell::GetState(SfxItemSet &rSet) case SID_NOTEBOOKBAR: { - sfx2::SfxNotebookBar::StateMethod(mpViewShell->GetFrame()->GetBindings(), "modules/simpress/ui/notebookbar.ui"); + sfx2::SfxNotebookBar::StateMethod(mpViewShell->GetFrame()->GetBindings(), "modules/simpress/ui/"); } break; -- cgit