From 54fa0d51da514e2ac8b66b632116a1d5ec3dd5aa 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 +----- status.22x | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index 710737e782..36eded9c4b 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1756,13 +1756,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()){ diff --git a/status.22x b/status.22x index 11c734a822..d600c4b257 100644 --- a/status.22x +++ b/status.22x @@ -162,6 +162,12 @@ What's new - Fix display and output of math macros with optional arguments appearing in the optional argument of another macro. +- Do not prematurely cut selected text when inserting a Hyperref (bug 10306). + +- Consider the argument of the hyperref-insert function even if there is a + selection. + + * INTERNALS -- 2.39.5