diff options
author | andreas kainz <kainz.a@gmail.com> | 2018-10-17 21:41:25 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-10-29 08:23:23 +0100 |
commit | 128ecffe53394c1f045521c2efb42ea03a319f4b (patch) | |
tree | 40316dff3279e03624118cab271d1c1e19b75db4 | |
parent | ac51f1dfb3c63f1d0a3e2577ba5a56c25bc0b94b (diff) |
Notebookbar: add context-Printpreview to calc tabbed NB
Change-Id: I9b63a515c407692f5632cb5e1f391593cfd68736
Reviewed-on: https://gerrit.libreoffice.org/62433
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 15 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/notebookbar.ui | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 01ca947a8251..15074ddf2a04 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,15 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame, { Construct( &pViewFrame->GetWindow() ); + SfxShell::SetContextBroadcasterEnabled(true); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Printpreview)); + SfxShell::BroadcastContextForActivation(true); + + + auto& pNotebookBar = pViewFrame->GetWindow().GetSystemWindow()->GetNotebookBar(); + if (pNotebookBar) + pNotebookBar->ControlListener(true); + if ( auto pTabViewShell = dynamic_cast<ScTabViewShell*>( pOldSh) ) { // store view settings, show table from TabView @@ -181,6 +193,9 @@ ScPreviewShell::~ScPreviewShell() if (mpFrameWindow) mpFrameWindow->SetCloseHdl(Link<SystemWindow&,void>()); // Remove close handler. + if (auto& pBar = GetViewFrame()->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 5f0b0d9b4802..de1c182856d8 100644 --- a/sc/uiconfig/scalc/ui/notebookbar.ui +++ b/sc/uiconfig/scalc/ui/notebookbar.ui @@ -12873,6 +12873,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> |