From 71b660a226176a0d5e420572e004166d0301844f Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 12 Aug 2019 10:45:58 +0200 Subject: 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 --- sw/source/uibase/shells/drwtxtex.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sw/source') diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 2f5ae1a43019..2354f2a58489 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -490,13 +490,15 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) case SID_EDIT_HYPERLINK: { // Ensure the field is selected first - pOLV->GetFieldAtCursor(); + pOLV->SelectFieldAtCursor(); GetView().GetViewFrame()->GetDispatcher()->Execute(SID_HYPERLINK_DIALOG); } break; case SID_REMOVE_HYPERLINK: { + // Ensure the field is selected first + pOLV->SelectFieldAtCursor(); URLFieldHelper::RemoveURLField(pSdrView->GetTextEditOutliner(), pOLV); } -- cgit