diff options
author | andreas kainz <kainz.a@gmail.com> | 2018-10-17 21:41:25 +0200 |
---|---|---|
committer | andreas_kainz <kainz.a@gmail.com> | 2018-10-18 21:02:24 +0200 |
commit | 3f9c477929c261a8862411c00153e4c7d0d0ae7c (patch) | |
tree | ba061267353e94e210bc25480408724d442e505d | |
parent | ac2b58cdae26375846f67bfbe7244e4a0fd306ba (diff) |
Notebookbar: add context-Printpreview to calc tabbed NB
Change-Id: Iee6c83ae03ead7ae0b2c33f6cf364c1c3c59528f
Reviewed-on: https://gerrit.libreoffice.org/61892
Reviewed-by: andreas_kainz <kainz.a@gmail.com>
Tested-by: andreas_kainz <kainz.a@gmail.com>
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 13 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/notebookbar.ui | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 42d6700d0ab5..1ad9c412f049 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -69,6 +69,9 @@ #include <com/sun/star/document/XDocumentProperties.hpp> #include <scabstdlg.hxx> +#include <vcl/EnumContext.hxx> +#include <vcl/notebookbar.hxx> + // for mouse wheel #define MINZOOM_SLIDER 10 #define MAXZOOM_SLIDER 400 @@ -155,6 +158,13 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame, { Construct( &pViewFrame->GetWindow() ); + SfxShell::SetContextBroadcasterEnabled(true); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Printpreview)); + SfxShell::BroadcastContextForActivation(true); + + if (auto& pBar = SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar()) + pBar->ControlListener(true); + if ( auto pTabViewShell = dynamic_cast<ScTabViewShell*>( pOldSh) ) { // store view settings, show table from TabView @@ -181,6 +191,9 @@ ScPreviewShell::~ScPreviewShell() if (mpFrameWindow) mpFrameWindow->SetCloseHdl(Link<SystemWindow&,void>()); // Remove close handler. + if (auto& pBar = SfxViewFrame::Current()->GetWindow().GetSystemWindow()->GetNotebookBar()) + pBar->ControlListener(false); + // #108333#; notify Accessibility that Shell is dying and before destroy all BroadcastAccessibility( SfxHint( SfxHintId::Dying ) ); pAccessibilityBroadcaster.reset(); diff --git a/sc/uiconfig/scalc/ui/notebookbar.ui b/sc/uiconfig/scalc/ui/notebookbar.ui index ca39249bc22f..418cb46f549c 100644 --- a/sc/uiconfig/scalc/ui/notebookbar.ui +++ b/sc/uiconfig/scalc/ui/notebookbar.ui @@ -12841,6 +12841,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes" context="CalcNotebookbar|PrintLabel">Print</property> + <style> + <class name="context-Printpreview"/> + </style> </object> <packing> <property name="position">12</property> |