diff options
author | Ignacio Casal Quinteiro <icq@gnome.org> | 2011-01-28 13:24:26 +0100 |
---|---|---|
committer | Ignacio Casal Quinteiro <icq@gnome.org> | 2011-01-28 13:26:00 +0100 |
commit | b7de18ab35e587df98032eaaa3d159d8f8fd64f4 (patch) | |
tree | 184632afd3cfc3a17c649452cfdb7fa0360d9233 | |
parent | 1cd82eff4be800d9c8ccdc26a3ec15b740a79c7d (diff) | |
download | gtk+-b7de18ab35e587df98032eaaa3d159d8f8fd64f4.tar.gz |
Remove gtk_paste_point_override mark if we don't insert any text.
This patch fixes bug #590459.
-rw-r--r-- | gtk/gtktextbuffer.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 3a4535777b..58ca341d32 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -3292,9 +3292,7 @@ get_paste_point (GtkTextBuffer *buffer, gtk_text_buffer_get_iter_at_mark (buffer, &insert_point, paste_point_override); if (clear_afterward) - gtk_text_buffer_delete_mark (buffer, - gtk_text_buffer_get_mark (buffer, - "gtk_paste_point_override")); + gtk_text_buffer_delete_mark (buffer, paste_point_override); } else { @@ -3393,6 +3391,18 @@ clipboard_text_received (GtkClipboard *clipboard, emit_paste_done (buffer, clipboard); } + else + { + /* It may happen that we set a point override but we are not inserting + any text, so we must remove it afterwards */ + GtkTextMark *paste_point_override; + + paste_point_override = gtk_text_buffer_get_mark (buffer, + "gtk_paste_point_override"); + + if (paste_point_override != NULL) + gtk_text_buffer_delete_mark (buffer, paste_point_override); + } free_clipboard_request (request_data); } |