Refactor common code in dialog implementations
[pspp-builds.git] / src / ui / gui / recode-dialog.c
index da32620b126fbde4d7a346442043954308fdabd3..642dae02d4a01283276c86356618b79cf7689603 100644 (file)
@@ -33,7 +33,7 @@
 #include <ui/gui/helper.h>
 #include <ui/gui/psppire-dialog.h>
 #include <ui/gui/psppire-var-store.h>
-#include <ui/gui/psppire-syntax-window.h>
+#include <ui/gui/helper.h>
 #include <ui/syntax-gen.h>
 
 #include "psppire-acr.h"
@@ -1085,6 +1085,7 @@ recode_dialog (PsppireDataWindow *de, gboolean diff)
     case GTK_RESPONSE_OK:
       {
        gchar *syntax = generate_syntax (&rd);
+
        struct getl_interface *sss = create_syntax_string_source (syntax);
        execute_syntax (sss);
 
@@ -1094,12 +1095,7 @@ recode_dialog (PsppireDataWindow *de, gboolean diff)
     case PSPPIRE_RESPONSE_PASTE:
       {
        gchar *syntax = generate_syntax (&rd);
-
-        GtkWidget *se = psppire_syntax_window_new ();
-
-       gtk_text_buffer_insert_at_cursor (PSPPIRE_SYNTAX_WINDOW (se)->buffer, syntax, -1);
-
-       gtk_widget_show (se);
+        paste_syntax_in_new_window (syntax);
 
        g_free (syntax);
       }