X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-syntax-window.c;h=0c05fdc58e167436ac0419faaf118ca894f3f200;hb=0a2ee97da7736d31c23b6b2cac91303b925dab50;hp=9f9e90a908303ba2181cad5f7a380c5326e45021;hpb=fea925912b94d356a579598031abe54a191903fc;p=pspp diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 9f9e90a908..0c05fdc58e 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation + Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,6 @@ #include #include - #include "language/lexer/lexer.h" #include "libpspp/encoding-guesser.h" #include "libpspp/i18n.h" @@ -32,13 +31,13 @@ #include "ui/gui/executor.h" #include "ui/gui/help-menu.h" #include "ui/gui/helper.h" +#include "ui/gui/builder-wrapper.h" #include "ui/gui/psppire-data-window.h" #include "ui/gui/psppire-encoding-selector.h" -#include "ui/gui/psppire-syntax-window.h" +#include "ui/gui/psppire-lex-reader.h" #include "ui/gui/psppire-syntax-window.h" #include "ui/gui/psppire-window-register.h" #include "ui/gui/psppire.h" -#include "ui/gui/psppire.h" #include "gl/localcharset.h" #include "gl/xalloc.h" @@ -251,10 +250,7 @@ editor_execute_syntax (const PsppireSyntaxWindow *sw, GtkTextIter start, GtkTextIter stop) { PsppireWindow *win = PSPPIRE_WINDOW (sw); - struct lex_reader *reader; - gchar *text = gtk_text_buffer_get_text (GTK_TEXT_BUFFER (sw->buffer), &start, &stop, FALSE); - reader = lex_reader_for_string (text); - g_free (text); + struct lex_reader *reader = lex_reader_for_gtk_text_buffer (GTK_TEXT_BUFFER (sw->buffer), start, stop); lex_reader_set_file_name (reader, psppire_window_get_filename (win)); @@ -380,7 +376,6 @@ contents_received_callback (GtkClipboard *clipboard, GtkSelectionData *sd, gpointer data) { - gchar *c; PsppireSyntaxWindow *syntax_window = data; if ( sd->length < 0 ) @@ -389,8 +384,6 @@ contents_received_callback (GtkClipboard *clipboard, if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE)) return; - c = (gchar *) sd->data; - gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (syntax_window->buffer), (gchar *) sd->data, sd->length);