[Libreoffice-commits] core.git: sw/inc sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Mar 11 18:07:45 UTC 2019


 sw/inc/strings.hrc                 |    1 +
 sw/source/uibase/inc/swcont.hxx    |    2 +-
 sw/source/uibase/utlui/content.cxx |   15 +++++++++++++--
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 9ccdb944a6bfde317febbf7cfc37ae8e6e6df8c9
Author:     Wenzhe Pei <pwz26626664 at gmail.com>
AuthorDate: Mon Mar 11 01:25:52 2019 +0000
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Mar 11 19:07:19 2019 +0100

    tdf#123395 Add "Send Outline to Clipboard" to Navigator->Context menu
    
    Change-Id: Ice8f6a99e437e99c7e169e230e034a04f42eea0d
    Reviewed-on: https://gerrit.libreoffice.org/69026
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 2093a2d8c14f..fe4ab39acd33 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -621,6 +621,7 @@
 #define STR_ACCESS_TL_CONTENT                   NC_("STR_ACCESS_TL_CONTENT", "Content Navigation View")
 #define STR_OUTLINE_LEVEL                       NC_("STR_OUTLINE_LEVEL", "Outline Level")
 #define STR_DRAGMODE                            NC_("STR_DRAGMODE", "Drag Mode")
+#define STR_SEND_OUTLINE_TO_CLIPBOARD_ENTRY     NC_("STR_SEND_OUTLINE_TO_CLIPBOARD_ENTRY", "Send Outline to Clipboard")
 #define STR_HYPERLINK                           NC_("STR_HYPERLINK", "Insert as Hyperlink")
 #define STR_LINK_REGION                         NC_("STR_LINK_REGION", "Insert as Link")
 #define STR_COPY_REGION                         NC_("STR_COPY_REGION", "Insert as Copy")
diff --git a/sw/source/uibase/inc/swcont.hxx b/sw/source/uibase/inc/swcont.hxx
index 3d0aaf69a113..f116935d2edf 100644
--- a/sw/source/uibase/inc/swcont.hxx
+++ b/sw/source/uibase/inc/swcont.hxx
@@ -44,7 +44,7 @@ enum class ContentTypeId
 };
 
 // strings for context menus
-#define CONTEXT_COUNT   12
+#define CONTEXT_COUNT   13
 #define GLOBAL_CONTEXT_COUNT 14
 
 // modes for Drag 'n Drop
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 9d27cd0ef02f..a59152b00210 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -828,7 +828,8 @@ enum STR_CONTEXT_IDX
     IDX_STR_ACTIVE = 8,
     IDX_STR_INACTIVE = 9,
     IDX_STR_EDIT_ENTRY = 10,
-    IDX_STR_DELETE_ENTRY = 11
+    IDX_STR_DELETE_ENTRY = 11,
+    IDX_STR_SEND_OUTLINE_TO_CLIPBOARD_ENTRY = 12
 };
 
 static const char* STR_CONTEXT_ARY[] =
@@ -844,7 +845,8 @@ static const char* STR_CONTEXT_ARY[] =
     STR_ACTIVE,
     STR_INACTIVE,
     STR_EDIT_ENTRY,
-    STR_DELETE_ENTRY
+    STR_DELETE_ENTRY,
+    STR_SEND_OUTLINE_TO_CLIPBOARD_ENTRY
 };
 
 SwContentTree::SwContentTree(vcl::Window* pParent, SwNavigationPI* pDialog)
@@ -1316,6 +1318,10 @@ VclPtr<PopupMenu> SwContentTree::CreateContextMenu()
     {
         assert(dynamic_cast<SwContentType*>(static_cast<SwTypeNumber*>(pEntry->GetUserData())));
         SwContentType* pType = static_cast<SwContentType*>(pEntry->GetUserData());
+        if(ContentTypeId::OUTLINE == pType->GetType())
+        {
+            pPop->InsertItem(700, m_aContextStrings[IDX_STR_SEND_OUTLINE_TO_CLIPBOARD_ENTRY]);
+        }
         if ( (pType->GetType() == ContentTypeId::POSTIT) &&  (!m_pActiveShell->GetView().GetDocShell()->IsReadOnly()) && ( pType->GetMemberCount() > 0) )
         {
             bSubPop4 = true;
@@ -3116,6 +3122,11 @@ void SwContentTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry )
                 m_pActiveShell->GetView().GetPostItMgr()->Delete();
                 break;
             }
+        case 700:
+            {
+                m_pActiveShell->GetView().GetViewFrame()->GetDispatcher()->Execute(FN_OUTLINE_TO_CLIPBOARD);
+                break;
+            }
         //Display
         default:
         if(nSelectedPopupEntry > 300 && nSelectedPopupEntry < 400)


More information about the Libreoffice-commits mailing list