summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorgokaysatir <gokaysatir@collabora.com>2020-09-22 13:00:44 +0300
committerJan Holesovsky <kendy@collabora.com>2020-09-30 15:08:16 +0200
commit9162014433f1c40b88e1093dfb458436e8ecf007 (patch)
tree61fdc53b6c0bdded66eec72cb093cb4c199a5dcd /sw
parente3970b941db8783692beb606b7d9de4f833cb31b (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>
Diffstat (limited to 'sw')
-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 2d9ed1994727..a8389f3508ab 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -129,6 +129,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;
@@ -1358,10 +1359,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);