From feddb0d0be4cd39cca437cab738140c9db3dd0b6 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 7 Jan 2015 20:03:09 +0100 Subject: [PATCH] Syntax Window: Simplify the Edit|Paste callback. Apparently pasting into the Syntax Window under Windoze didn't work. This change makes the EditPaste callback simpler and apparently it fixes the problem. Thanks to Alan Mead for reporting the problem and to Harry Thissen for testing the fix. --- src/ui/gui/psppire-syntax-window.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 8491eb3142..ca04756069 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -370,26 +370,6 @@ on_edit_copy (PsppireSyntaxWindow *sw) } -/* A callback for when the clipboard contents have been received */ -static void -contents_received_callback (GtkClipboard *clipboard, - GtkSelectionData *sd, - gpointer data) -{ - PsppireSyntaxWindow *syntax_window = data; - - if ( sd->length < 0 ) - return; - - if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE)) - return; - - gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (syntax_window->buffer), - (gchar *) sd->data, - sd->length); - -} - static void on_edit_paste (PsppireSyntaxWindow *sw) { @@ -397,10 +377,7 @@ on_edit_paste (PsppireSyntaxWindow *sw) GtkClipboard *clipboard = gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD); - gtk_clipboard_request_contents (clipboard, - gdk_atom_intern ("UTF8_STRING", TRUE), - contents_received_callback, - sw); + gtk_text_buffer_paste_clipboard (GTK_TEXT_BUFFER (sw->buffer), clipboard, NULL, TRUE); } -- 2.30.2