summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-04 15:19:00 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-06 08:17:10 +0100
commit64233bbaa0e91ddf14d59ae7547df6bbfa60adcc (patch)
treec17bed3b00de030ac4cf57132b21fea5144c3401 /sd
parentc45acdcdd022a17559b9f7b85790c656a1599339 (diff)
tdf#128666 Only enable hyperlink actions when just the field is selected
Change-Id: I984df967877a47fb9f89c3626737348a87d3ffa5 Reviewed-on: https://gerrit.libreoffice.org/84418 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit f31c3ebb60e4678eb09e377b638b368531df47dc) Reviewed-on: https://gerrit.libreoffice.org/84571
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviews2.cxx3
-rw-r--r--sd/source/ui/view/drviews7.cxx15
-rw-r--r--sd/source/ui/view/drviewsf.cxx2
3 files changed, 5 insertions, 15 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 2be1ccd2c6c2..b2ba46958b5d 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1200,8 +1200,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
if (pOutView)
pOutView->SelectFieldAtCursor();
- URLFieldHelper::RemoveURLField(mpDrawView->GetTextEditOutliner(),
- mpDrawView->GetTextEditOutlinerView());
+ URLFieldHelper::RemoveURLField(pOutView->GetEditView());
}
}
Cancel();
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 7372d2327ff0..0874a587a3a1 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -33,6 +33,7 @@
#include <editeng/flditem.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/sizeitem.hxx>
+#include <editeng/urlfieldhelper.hxx>
#include <officecfg/Office/Impress.hxx>
#include <svx/svxids.hrc>
#include <svx/svdpagv.hxx>
@@ -1449,18 +1450,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if( mpDrawView->IsTextEdit() )
{
OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
- if (pOLV)
- {
- const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
- if (!pFieldItem)
- pFieldItem = pOLV->GetFieldAtSelection();
- if (pFieldItem)
- {
- const SvxFieldData* pField = pFieldItem->GetField();
- if (dynamic_cast<const SvxURLField*>(pField))
- bDisableEditHyperlink = false;
- }
- }
+ if (pOLV && URLFieldHelper::IsCursorAtURLField(pOLV->GetEditView()))
+ bDisableEditHyperlink = false;
}
else
{
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 565283ce1c3a..5533c62510b8 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -505,7 +505,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
case SID_REMOVE_HYPERLINK:
{
- if (!URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()))
+ if (!URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()->GetEditView()))
rSet.DisableItem(nWhich);
}
break;