summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-08-12 10:45:58 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-08-12 12:50:11 +0200
commit71b660a226176a0d5e420572e004166d0301844f (patch)
treefc091f735380bb48f1d3c095193732b23b81a5fe /sc
parent22ad284969afc640006cb493a639130a7cf5d979 (diff)
Don't select hyperlink fields arbitrarily
For some functions, like remove or edit hyperlink, it's required that the hyperlink field is selected. However, we should do that only when executing the function, not when queriying its status. This led to selection changes on mouse over/right click. Change-Id: I22035698032d1e651aae6a74d6e445dfe044bf74 Reviewed-on: https://gerrit.libreoffice.org/77336 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx6
-rw-r--r--sc/source/ui/view/editsh.cxx4
2 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 334f1933a88b..92910b2dea87 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -274,7 +274,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
bool bDone = false;
if (eMode == HLINK_DEFAULT || eMode == HLINK_FIELD)
{
- pOutView->GetFieldAtCursor();
+ pOutView->SelectFieldAtCursor();
// insert new field
SvxURLField aURLField( rURL, rName, SvxURLFormat::Repr );
@@ -306,7 +306,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_EDIT_HYPERLINK:
{
// Ensure the field is selected first
- pOutView->GetFieldAtCursor();
+ pOutView->SelectFieldAtCursor();
pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_HYPERLINK_DIALOG);
}
break;
@@ -325,6 +325,8 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_REMOVE_HYPERLINK:
{
+ // Ensure the field is selected first
+ pOutView->SelectFieldAtCursor();
URLFieldHelper::RemoveURLField(pOutliner, pOutView);
}
break;
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 932bc0d6fda6..8cda154cd702 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -627,7 +627,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_EDIT_HYPERLINK:
{
// Ensure the field is selected first
- pEditView->GetFieldAtCursor();
+ pEditView->SelectFieldAtCursor();
pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(
SID_HYPERLINK_DIALOG);
}
@@ -646,7 +646,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_REMOVE_HYPERLINK:
{
// Ensure the field is selected first
- pEditView->GetFieldAtCursor();
+ pEditView->SelectFieldAtCursor();
const SvxURLField* pURLField = GetURLField();
if (pURLField)
{