]> git.lyx.org Git - features.git/commitdiff
Fix two hyperlink-insert problems
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 29 Dec 2016 08:17:53 +0000 (09:17 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 29 Dec 2016 18:30:36 +0000 (19:30 +0100)
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
status.22x

index 710737e7823f29eaf5b0d29d9afc790bb417a04e..36eded9c4b2c31ddaf53b219e44f65bc2c473a61 100644 (file)
@@ -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()){
index 11c734a822033d89e9f156593afbafb83bdba271..d600c4b2577384f04d7d3fd46948097ccbac36e2 100644 (file)
@@ -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