diff options
author | Justin Luth <jluth@mail.com> | 2023-11-06 14:23:16 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-11-15 20:04:52 +0100 |
commit | 0fc96d9b54e5a64c528bbf7fcdf9b71d74be8920 (patch) | |
tree | 7ff4b39462c51b1a4dc47d0d5c50692e68f6b08e /sd/source/ui/view | |
parent | aaca48eb12357fa5cf23054fe77554bcfff74e95 (diff) |
tdf#158031 editeng SID_OPEN_HYPERLINK: use AlsoCheckBeforeCursor
This patch depends on prior patches for this bug report.
This fixes nothing being opened 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).
Note that for some reason, OPEN always seemed to work with the mouse,
even though other hyperlink menu options using the same code
failed to find the field! So this code change is mainly for consistency.
However, I WAS able to make it always fail,
by moving the mouse away once the popup menu arrived,
and then using the KEYBOARD to "Open Hyperlink".
In that case, it always failed (because the field
was not selected, and not under the mouse).
Change-Id: I8fcd0386de6cea8c6a937afb6f63061ed62d4cb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159016
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index fab59b59f00a..ae77f5593045 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2243,7 +2243,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView(); if ( pOutView ) { - const SvxFieldData* pField = pOutView->GetFieldAtCursor(); + const SvxFieldItem* pFieldItem + = pOutView->GetFieldAtSelection(/*AlsoCheckBeforeCursor=*/true); + const SvxFieldData* pField = pFieldItem ? pFieldItem->GetField() : nullptr; if( auto pURLField = dynamic_cast< const SvxURLField *>( pField ) ) { SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() ); |