diff options
author | gokaysatir <gokaysatir@collabora.com> | 2020-09-22 13:00:44 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-10-06 08:28:20 +0200 |
commit | ecbfd8963ce5b8459c00da589216ecf78d99a7f8 (patch) | |
tree | 166344d2a7d2f4203c635294b524c037b712e6d6 /sd | |
parent | fix Graphic duplication in import and add GraphicMapper (diff) | |
download | core-ecbfd8963ce5b8459c00da589216ecf78d99a7f8.tar.gz core-ecbfd8963ce5b8459c00da589216ecf78d99a7f8.zip |
Online: Copy hyperlink location. / Core side.
Payload format is added to LOK_CALLBACK_CLIPBOARD_CHANGED.
Clipboard changed event is not fired when "copy hyperlink location" command is issued.
So i added a call to LOK_CALLBACK_CLIPBOARD_CHANGED inside TextDataObject::CopyStringTo function.
Change-Id: I8157572288da88b5522662e13abe151ef8548b34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103164
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103729
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/sdi/_drvwsh.sdi | 5 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 31 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 3 | ||||
-rw-r--r-- | sd/uiconfig/sdraw/popupmenu/drawtext.xml | 1 | ||||
-rw-r--r-- | sd/uiconfig/simpress/popupmenu/drawtext.xml | 1 |
5 files changed, 41 insertions, 0 deletions
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index d7c836cc5b58..c6165d1e0456 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -2262,6 +2262,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 2806de91bf46..e49add9e34e5 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -100,6 +100,7 @@ #include <vcl/graph.hxx> #include <vcl/svapp.hxx> +#include <vcl/unohelp2.hxx> #include <vcl/waitobj.hxx> #include <vcl/weld.hxx> @@ -2210,6 +2211,36 @@ 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(); + + if (comphelper::LibreOfficeKit::isActive()) + { + std::function<void (int, const char*)> callback = [&] (int callbackType, const char* text) + { + SfxViewFrame* pFrame = GetViewFrame(); + pFrame->GetViewShell()->libreOfficeKitViewCallback(callbackType, text); + }; + vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, &callback); + } + else + 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 318a36af8856..bff0ceea6f29 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1507,7 +1507,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 0b47863183e6..75fd87f33834 100644 --- a/sd/uiconfig/sdraw/popupmenu/drawtext.xml +++ b/sd/uiconfig/sdraw/popupmenu/drawtext.xml @@ -19,6 +19,7 @@ <menu:menuitem menu:id=".uno:ParagraphDialog"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/> + <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/> <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 53d8910b4d8c..f8d24606bd80 100644 --- a/sd/uiconfig/simpress/popupmenu/drawtext.xml +++ b/sd/uiconfig/simpress/popupmenu/drawtext.xml @@ -18,6 +18,7 @@ <menu:menuitem menu:id=".uno:ParagraphDialog"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/> + <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/> <menu:menuitem menu:id=".uno:ThesaurusFromContext"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:SetDefault"/> |