gui: Make syntax execution functions take a PsppireDataWindow argument.
[pspp-builds.git] / src / ui / gui / sort-cases-dialog.c
index 22c537812311eb232837062c384b5a91dc22db70..6977469b7ecdd6b101a3058b0e40c321495d896b 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2007  Free Software Foundation
+   Copyright (C) 2007, 2010, 2011  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
@@ -26,7 +26,6 @@
 #include "dict-display.h"
 #include "psppire-var-view.h"
 
-#include <language/syntax-string-source.h>
 #include "helper.h"
 
 static void
@@ -90,10 +89,9 @@ generate_syntax (const struct sort_cases_dialog *scd)
 
 /* Pops up the Sort Cases dialog box */
 void
-sort_cases_dialog (GObject *o, gpointer data)
+sort_cases_dialog (PsppireDataWindow *de)
 {
   gint response;
-  PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data);
 
   struct sort_cases_dialog scd;
 
@@ -130,22 +128,10 @@ sort_cases_dialog (GObject *o, gpointer data)
   switch (response)
     {
     case GTK_RESPONSE_OK:
-      {
-       gchar *syntax = generate_syntax (&scd);
-
-       struct getl_interface *sss = create_syntax_string_source (syntax);
-       execute_syntax (sss);
-
-       g_free (syntax);
-      }
+      g_free (execute_syntax_string (de, generate_syntax (&scd)));
       break;
     case PSPPIRE_RESPONSE_PASTE:
-      {
-       gchar *syntax = generate_syntax (&scd);
-        paste_syntax_in_new_window (syntax);
-
-       g_free (syntax);
-      }
+      g_free (paste_syntax_to_window (generate_syntax (&scd)));
       break;
     default:
       break;