mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 02:35:20 +00:00
Fix two hyperlink-insert problems
1. Do not prematurely cut selection (#10306); patch proposed by Daniel Ramöller 2. Obey lfun argument, even if there is a selection
This commit is contained in:
parent
03754c327e
commit
54fa0d51da
@ -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()){
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user