summaryrefslogtreecommitdiff
path: root/sc/source/ui/drawfunc
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-11-06 13:41:05 -0500
committerJustin Luth <jluth@mail.com>2023-11-15 20:04:37 +0100
commitaaca48eb12357fa5cf23054fe77554bcfff74e95 (patch)
tree154941e21bee456ccc8a23f6a5f5d5cf9bc18755 /sc/source/ui/drawfunc
parent023a2de2a8ef4bdcd9877e60f8739366de3a763c (diff)
tdf#158031 editeng SID_COPY_HYPERLINK: use AlsoCheckBeforeCursor
This patch depends on prior patches for this bug report. This fixes nothing being copied if the mouse was right-clicked over that second half of the hyperlink (since a "smart" positioning set the cursor after the field instead of before it). Change-Id: I6c933224cd8d36f48f4e1f0aafaa1f45555e46d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159015 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/drawfunc')
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index ec527db045ac..65da5aac262c 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -311,7 +311,9 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_COPY_HYPERLINK_LOCATION:
{
- const SvxFieldData* pField = pOutView->GetFieldAtCursor();
+ const SvxFieldItem* pFieldItem
+ = pOutView->GetFieldAtSelection(/*AlsoCheckBeforeCursor=*/true);
+ const SvxFieldData* pField = pFieldItem ? pFieldItem->GetField() : nullptr;
if (const SvxURLField* pURLField = dynamic_cast<const SvxURLField*>(pField))
{
uno::Reference<datatransfer::clipboard::XClipboard> xClipboard