[Libreoffice-commits] core.git: sd/sdi sd/source sd/uiconfig
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 6 12:47:25 UTC 2019
sd/sdi/_drvwsh.sdi | 5 +++++
sd/source/ui/view/drviews2.cxx | 20 ++++++++++++++++++++
sd/source/ui/view/drviews7.cxx | 3 +++
sd/uiconfig/sdraw/popupmenu/drawtext.xml | 3 +++
sd/uiconfig/simpress/popupmenu/drawtext.xml | 1 +
5 files changed, 32 insertions(+)
New commits:
commit 37fc9f51a8de11d40632e8cda17ccf1fa4b1f503
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Aug 6 13:59:50 2019 +0200
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Aug 6 14:46:31 2019 +0200
Add missing hyperlink context menu entries to sd
* Impress: Add "Copy Hyperlink location"
* Draw: Add "Copy Hyperlink location", "Edit hyperlink", "Remove Hyperlink"
Change-Id: I1357285f8d5fa31419275c9d65cef61d2accf326
Reviewed-on: https://gerrit.libreoffice.org/77020
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 3c98b281347f..25ebcceb66cc 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2267,6 +2267,11 @@ interface DrawView
ExecMethod = FuTemporary ;
StateMethod = GetMenuState ;
]
+ SID_COPY_HYPERLINK_LOCATION // ole : no, status : ?
+ [
+ ExecMethod = FuTemporary ;
+ StateMethod = GetMenuState ;
+ ]
SID_HIDE_LAST_LEVEL // ole : no, status : ?
[
ExecMethod = FuTemporary ;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 63d5c5709d7b..036862ed0229 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -102,6 +102,7 @@
#include <vcl/graph.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/unohelp2.hxx>
#include <vcl/waitobj.hxx>
#include <vcl/weld.hxx>
@@ -2164,6 +2165,25 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
break;
+ case SID_COPY_HYPERLINK_LOCATION:
+ {
+ OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
+ if ( pOutView )
+ {
+ const SvxFieldData* pField = pOutView->GetFieldAtCursor();
+ if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField))
+ {
+ uno::Reference<datatransfer::clipboard::XClipboard> xClipboard
+ = pOutView->GetWindow()->GetClipboard();
+ vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard);
+ }
+ }
+
+ Cancel();
+ rReq.Done ();
+ }
+ break;
+
case SID_HYPERLINK_SETLINK:
{
const SfxItemSet* pReqArgs = rReq.GetArgs();
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index f69c566021f2..390abefe2f42 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1513,7 +1513,10 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
rSet.DisableItem( SID_EDIT_HYPERLINK );
if ( bDisableEditHyperlink )
+ {
rSet.DisableItem( SID_OPEN_HYPERLINK );
+ rSet.DisableItem( SID_COPY_HYPERLINK_LOCATION );
+ }
//fdo#78151 enable show next level/hide last level if editing a master page
//PRESOBJ_OUTLINE object and the current selection allow that to happen
diff --git a/sd/uiconfig/sdraw/popupmenu/drawtext.xml b/sd/uiconfig/sdraw/popupmenu/drawtext.xml
index eb351f4513ce..3cb30bc3f5b2 100644
--- a/sd/uiconfig/sdraw/popupmenu/drawtext.xml
+++ b/sd/uiconfig/sdraw/popupmenu/drawtext.xml
@@ -19,6 +19,9 @@
<menu:menuitem menu:id=".uno:OutlineBullet"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+ <menu:menuitem menu:id=".uno:EditHyperlink"/>
+ <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+ <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
<menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:SetDefault"/>
diff --git a/sd/uiconfig/simpress/popupmenu/drawtext.xml b/sd/uiconfig/simpress/popupmenu/drawtext.xml
index 70e153b14afa..d0b1a95280bb 100644
--- a/sd/uiconfig/simpress/popupmenu/drawtext.xml
+++ b/sd/uiconfig/simpress/popupmenu/drawtext.xml
@@ -20,6 +20,7 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
<menu:menuitem menu:id=".uno:EditHyperlink"/>
+ <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
<menu:menuitem menu:id=".uno:RemoveHyperlink"/>
<menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
<menu:menuseparator/>
More information about the Libreoffice-commits
mailing list