diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2016-08-11 13:53:20 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2016-08-16 07:11:25 +0000 |
commit | af97c180983e5a8ac147b97f7773d483bba8cfef (patch) | |
tree | dc16d54bdb452b7ce2a18aa83bd1585ed6ea76e4 /sw/source/uibase/app | |
parent | 5b1095fc03e90506cb8ed956fafb528d4f6b0044 (diff) |
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 <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r-- | sw/source/uibase/app/docsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index c0068d01db76..06708852497c 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -1073,7 +1073,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) case SID_NOTEBOOKBAR: { SfxViewShell* pViewShell = GetView()? GetView(): SfxViewShell::Current(); - sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame()->GetBindings(), "modules/swriter/ui/notebookbar.ui"); + sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame()->GetBindings(), "modules/swriter/ui/"); } break; diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index b4607eb74544..d49a09f41e0e 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1160,8 +1160,18 @@ void SwDocShell::Execute(SfxRequest& rReq) break; case SID_NOTEBOOKBAR: { + const SfxStringItem* pFile = rReq.GetArg<SfxStringItem>( SID_NOTEBOOKBAR ); SfxViewShell* pViewShell = GetView()? GetView(): SfxViewShell::Current(); - sfx2::SfxNotebookBar::ExecMethod(pViewShell->GetViewFrame()->GetBindings()); + SfxBindings& rBindings( pViewShell->GetViewFrame()->GetBindings() ); + + if ( !pFile || ( pFile && !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; |