The branch, 2.0.x, has been updated.

- Log -----------------------------------------------------------------

commit 111f15f335f1c7fad2537e4df923b1d61978f75e
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Fri Jun 29 15:18:20 2012 +0200

    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.

diff --git a/src/Text3.cpp b/src/Text3.cpp
index 5865afd..dc30d5a 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -1314,13 +1314,14 @@ 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_PRIMARY_SELECTION_PASTE:
+               cap::replaceSelection(cur);
                pasteString(cur, theSelection().get(),
                            cmd.argument() == "paragraph");
                break;
@@ -1329,6 +1330,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");
@@ -2809,7 +2811,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)
diff --git a/status.20x b/status.20x
index cfd8da5..def9da3 100644
--- a/status.20x
+++ b/status.20x
@@ -60,7 +60,10 @@ What's new
 
 * USER INTERFACE
 
-- Fix various crashes when single document is edited in more windows (bug 
8203).
+- Fix various crashes when single document is edited in more windows
+  (bug 8203).
+
+- Replace current selection when pasting (bug 8027).
 
 
 * DOCUMENTATION AND LOCALIZATION

-----------------------------------------------------------------------

Summary of changes:
 src/Text3.cpp |    5 +++--
 status.20x    |    5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to