summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorgokaysatir <gokaysatir@collabora.com>2020-09-22 13:00:44 +0300
committerGökay ŞATIR <gokaysatir@collabora.com>2020-10-06 18:47:39 +0200
commit19a0fbf456129e011cb9ab9ab6ab730cba274bbd (patch)
tree6037565ea6a511144fe5f6aa4528ce5e6bd86611 /sw/source
parent1f8fbff65d91f1d8297b94dd67fffceb7475dce5 (diff)
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/+/103872 Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/shells/textsh1.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 8944d9c8e5bc..14844e1134c1 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -100,6 +100,7 @@
#include <bookmrk.hxx>
#include <linguistic/misc.hxx>
#include <editeng/splwrap.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace ::com::sun::star;
using namespace com::sun::star::beans;
@@ -1349,10 +1350,16 @@ void SwTextShell::Execute(SfxRequest &rReq)
const SwFormatINetFormat& rINetFormat = dynamic_cast<const SwFormatINetFormat&>( aSet.Get(RES_TXTATR_INETFMT) );
if( nSlot == SID_COPY_HYPERLINK_LOCATION )
{
+ OUString hyperlinkLocation = rINetFormat.GetValue();
::uno::Reference< datatransfer::clipboard::XClipboard > xClipboard = GetView().GetEditWin().GetClipboard();
- vcl::unohelper::TextDataObject::CopyStringTo(
- rINetFormat.GetValue(),
- xClipboard );
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ std::function<void (int, const char*)> callback = [&] (int callbackType, const char* text) { GetView().libreOfficeKitViewCallback(callbackType, text); } ;
+ vcl::unohelper::TextDataObject::CopyStringTo(hyperlinkLocation, xClipboard, &callback );
+ }
+ else
+ vcl::unohelper::TextDataObject::CopyStringTo(hyperlinkLocation, xClipboard, nullptr );
}
else
rWrtSh.ClickToINetAttr(rINetFormat);