summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/editsh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/editsh.cxx')
-rw-r--r--sc/source/ui/view/editsh.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 3393ca3ad090..ba76f89c4651 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -655,7 +655,9 @@ void ScEditShell::Execute( SfxRequest& rReq )
break;
case SID_COPY_HYPERLINK_LOCATION:
{
- const SvxFieldData* pField = pEditView->GetFieldAtCursor();
+ const SvxFieldItem* pFieldItem
+ = pEditView->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