mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
Fix bug #8027: Edit->Paste Special->... does not replace selected text
Delete the selection before all paste-like lfuns. This was previoulsy done only for LFUN_PASTE, the others at best unset the selection.
This commit is contained in:
parent
0ef36860c3
commit
c7549c1b54
@ -1331,18 +1331,19 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
|
||||
case LFUN_CLIPBOARD_PASTE:
|
||||
cur.clearSelection();
|
||||
cap::replaceSelection(cur);
|
||||
pasteClipboardText(cur, bv->buffer().errorList("Paste"),
|
||||
cmd.argument() == "paragraph");
|
||||
bv->buffer().errors("Paste");
|
||||
break;
|
||||
|
||||
case LFUN_CLIPBOARD_PASTE_SIMPLE:
|
||||
cur.clearSelection();
|
||||
cap::replaceSelection(cur);
|
||||
pasteSimpleText(cur, cmd.argument() == "paragraph");
|
||||
break;
|
||||
|
||||
case LFUN_PRIMARY_SELECTION_PASTE:
|
||||
cap::replaceSelection(cur);
|
||||
pasteString(cur, theSelection().get(),
|
||||
cmd.argument() == "paragraph");
|
||||
break;
|
||||
@ -1351,6 +1352,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
||||
// Copy the selection buffer to the clipboard stack,
|
||||
// because we want it to appear in the "Edit->Paste
|
||||
// recent" menu.
|
||||
cap::replaceSelection(cur);
|
||||
cap::copySelectionToStack();
|
||||
cap::pasteSelection(bv->cursor(), bv->buffer().errorList("Paste"));
|
||||
bv->buffer().errors("Paste");
|
||||
@ -2836,7 +2838,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
void Text::pasteString(Cursor & cur, docstring const & clip,
|
||||
bool asParagraphs)
|
||||
{
|
||||
cur.clearSelection();
|
||||
if (!clip.empty()) {
|
||||
cur.recordUndo();
|
||||
if (asParagraphs)
|
||||
|
Loading…
Reference in New Issue
Block a user