diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-07-08 08:22:33 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-07-08 10:28:45 +0200 |
commit | 1c6218df32838dc77da8e15dc5ce47eadad1a13f (patch) | |
tree | 3ba3504e924b987a0d4f62972a0d9c6cefeed164 /sd/source/ui/view/drviews7.cxx | |
parent | 86876ff86ef19af20e1c7202e029bbde44051a07 (diff) |
Related tdf#98575 Allow editing link even when URL field is not selected
When the cursor is directly before or behind the URL field,
just extend the selection so that the link is editable.
Change-Id: I80afe40a1c40e2a02ec6adb18dbdb27b6e39c7d1
Reviewed-on: https://gerrit.libreoffice.org/75190
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sd/source/ui/view/drviews7.cxx')
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 1e663a8e4b61..801a70d2042a 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1454,16 +1454,14 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView(); if (pOLV) { - const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection(); + const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer(); + if (!pFieldItem) + pFieldItem = pOLV->GetFieldAtSelection(); if (pFieldItem) { - ESelection aSel = pOLV->GetSelection(); - if ( abs( aSel.nEndPos - aSel.nStartPos ) == 1 ) - { - const SvxFieldData* pField = pFieldItem->GetField(); - if ( dynamic_cast< const SvxURLField *>( pField ) != nullptr ) - bDisableEditHyperlink = false; - } + const SvxFieldData* pField = pFieldItem->GetField(); + if (dynamic_cast<const SvxURLField*>(pField)) + bDisableEditHyperlink = false; } } } |