diff options
author | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-12-04 11:31:43 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-12-04 11:33:20 +0100 |
commit | 5131750da6df95643e89127349b95df33be2feb4 (patch) | |
tree | 5a0334c2b2f9d9d3996219de6a334afff79eeb36 /sfx2 | |
parent | a5a836d8c43dc9cebbbf8af39bf0142de603a7c6 (diff) |
fdo#85937 Add 'Close Sidebar' command to Sidebar menu
Change-Id: I83248398a9a8f2a8abb4e10d7ef9f1c203dddbf5
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/Sidebar.hrc | 1 | ||||
-rw-r--r-- | sfx2/source/sidebar/Sidebar.src | 4 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 11 |
3 files changed, 16 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc index 06d1e04c4def..a351c1ea05e6 100644 --- a/sfx2/source/sidebar/Sidebar.hrc +++ b/sfx2/source/sidebar/Sidebar.hrc @@ -52,6 +52,7 @@ #define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL 132 #define STRING_CUSTOMIZATION 200 #define STRING_RESTORE 201 +#define STRING_HIDE_SIDEBAR 202 #define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1) #define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2) diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src index 548fa0298eb8..eaa55c08d870 100644 --- a/sfx2/source/sidebar/Sidebar.src +++ b/sfx2/source/sidebar/Sidebar.src @@ -154,6 +154,10 @@ Resource RID_SIDEBAR_RESOURCE { Text [en-US] = "Restore Default"; }; + String STRING_HIDE_SIDEBAR + { + Text [en-US] = "Close Sidebar"; + }; }; String SFX_STR_SIDEBAR_MORE_OPTIONS diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 478758704390..7f950a244413 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -63,6 +63,7 @@ using ::rtl::OUString; namespace { const static char gsReadOnlyCommandName[] = ".uno:EditDoc"; + const static char gsHideSidebarCommandName[] = ".uno:Sidebar"; const static sal_Int32 gnMaximumSidebarWidth (400); const static sal_Int32 gnWidthCloseThreshold (70); const static sal_Int32 gnWidthOpenThreshold (40); @@ -77,6 +78,7 @@ namespace { { MID_UNLOCK_TASK_PANEL = 1, MID_LOCK_TASK_PANEL, + MID_HIDE_SIDEBAR, MID_CUSTOMIZATION, MID_RESTORE_DEFAULT, MID_FIRST_PANEL, @@ -889,6 +891,7 @@ void SidebarController::ShowPopupMenu ( else pMenu->InsertItem(MID_UNLOCK_TASK_PANEL, SFX2_RESSTR(STR_SFX_UNDOCK)); + pMenu->InsertItem(MID_HIDE_SIDEBAR, SFX2_RESSTR(STRING_HIDE_SIDEBAR)); pCustomizationMenu->InsertSeparator(); pCustomizationMenu->InsertItem(MID_RESTORE_DEFAULT, SFX2_RESSTR(STRING_RESTORE)); @@ -924,6 +927,14 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu) mpTabBar->RestoreHideFlags(); break; + case MID_HIDE_SIDEBAR: + { + const util::URL aURL (Tools::GetURL(gsHideSidebarCommandName)); + Reference<frame::XDispatch> mxDispatch (Tools::GetDispatch(mxFrame, aURL)); + if (mxDispatch.is()) + mxDispatch->dispatch(aURL, Sequence<beans::PropertyValue>()); + break; + } default: { try |