From 3522782c44b5b8c94dcd82125868f5669fc0c9af Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Thu, 29 Dec 2016 09:17:53 +0100 Subject: [PATCH] Fix two hyperlink-insert problems MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1. Do not prematurely cut selection (#10306); patch proposed by Daniel Ramöller 2. Obey lfun argument, even if there is a selection --- src/Text3.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index cc0a96f570..3e6fdf0e14 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1775,13 +1775,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_HREF_INSERT: { - // FIXME If we're actually given an argument, shouldn't - // we use it, whether or not we have a selection? docstring content = cmd.argument(); - if (cur.selection()) { + if (content.empty() && cur.selection()) content = cur.selectionAsString(false); - cutSelection(cur, true, false); - } InsetCommandParams p(HYPERLINK_CODE); if (!content.empty()){ -- 2.39.5