summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWenzhe Pei <pwz26626664@gmail.com>2019-03-11 01:25:52 +0000
committerMichael Stahl <Michael.Stahl@cib.de>2019-03-11 19:07:19 +0100
commit9ccdb944a6bfde317febbf7cfc37ae8e6e6df8c9 (patch)
treec4c154c2c8bef734196bb66601e80403a6c46427
parentc677598d146edef71898b92d087150b1534ac60a (diff)
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@cib.de>
-rw-r--r--sw/inc/strings.hrc1
-rw-r--r--sw/source/uibase/inc/swcont.hxx2
-rw-r--r--sw/source/uibase/utlui/content.cxx15
3 files changed, 15 insertions, 3 deletions
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)