From 599f6db17c4d2e23496fbd23b1dec53c2402e4b1 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Wed, 1 Jun 2016 21:47:27 +0200 Subject: notebookbar: load ui for the start center Change-Id: Iaf0e46436524e081edb287efd4074becaf02a98f Reviewed-on: https://gerrit.libreoffice.org/25799 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky --- sfx2/source/dialog/backingcomp.cxx | 8 ++++++++ sfx2/source/notebookbar/SfxNotebookBar.cxx | 12 +++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 7569830a6a0f..937501b4efa4 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -59,6 +59,7 @@ #include +#include namespace { @@ -429,6 +430,13 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f if( pBack ) pBack->setOwningFrame( m_xFrame ); + // set NotebookBar + SystemWindow* pSysWindow = static_cast(pParent); + if (pSysWindow) + { + sfx2::SfxNotebookBar::StateMethod(pSysWindow, m_xFrame, "sfx/ui/notebookbar.ui"); + } + // Set a minimum size for Start Center if( pParent && pBack ) { diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index d2d9409fc6f0..6888c5fe896e 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -29,17 +29,23 @@ void SfxNotebookBar::ExecMethod(SfxBindings& rBindings) void SfxNotebookBar::StateMethod(SfxBindings& rBindings, const OUString& rUIFile) { SfxFrame& rFrame = rBindings.GetDispatcher_Impl()->GetFrame()->GetFrame(); + StateMethod(rFrame.GetSystemWindow(), rFrame.GetFrameInterface(), rUIFile); +} +void SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, + const css::uno::Reference xFrame, + const OUString& rUIFile) +{ SvtViewOptions aViewOpt(E_WINDOW, "notebookbar"); if (aViewOpt.IsVisible()) { // setup if necessary - rFrame.GetSystemWindow()->SetNotebookBar(rUIFile, rFrame.GetFrameInterface()); + pSysWindow->SetNotebookBar(rUIFile, xFrame); - rFrame.GetSystemWindow()->GetNotebookBar()->Show(); + pSysWindow->GetNotebookBar()->Show(); } - else if (auto pNotebookBar = rFrame.GetSystemWindow()->GetNotebookBar()) + else if (auto pNotebookBar = pSysWindow->GetNotebookBar()) pNotebookBar->Hide(); } -- cgit