[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sfx2/source

Samuel Mehrbrodt s.mehrbrodt at gmail.com
Thu Dec 4 02:51:34 PST 2014


 sfx2/source/sidebar/Sidebar.hrc           |    1 +
 sfx2/source/sidebar/Sidebar.src           |    4 ++++
 sfx2/source/sidebar/SidebarController.cxx |   11 +++++++++++
 3 files changed, 16 insertions(+)

New commits:
commit f0b969179d8583a98849b0b8df1e1f5f130b3fbf
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date:   Thu Dec 4 11:31:43 2014 +0100

    fdo#85937 Add 'Close Sidebar' command to Sidebar menu
    
    Change-Id: I83248398a9a8f2a8abb4e10d7ef9f1c203dddbf5
    Reviewed-on: https://gerrit.libreoffice.org/13297
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc
index 06d1e04..a351c1e 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 548fa02..eaa55c0 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 db09eea..a0e05fc 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -66,6 +66,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);
@@ -81,6 +82,7 @@ namespace {
     {
         MID_UNLOCK_TASK_PANEL = 1,
         MID_LOCK_TASK_PANEL,
+        MID_HIDE_SIDEBAR,
         MID_CUSTOMIZATION,
         MID_RESTORE_DEFAULT,
         MID_FIRST_PANEL,
@@ -927,6 +929,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));
 
@@ -965,6 +968,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


More information about the Libreoffice-commits mailing list