Fix crash on Windows when calculating a covariance matrix of dimension 1.
[pspp-builds.git] / src / ui / gui / correlation-dialog.c
index ff6a254552345907a84c3ae4f371aaa1acdf47a8..afc23447a7af3636e58b1b69b28f3864951e5b48 100644 (file)
@@ -74,7 +74,7 @@ dialog_state_valid (gpointer data)
   GtkTreeModel *liststore =
     gtk_tree_view_get_model (GTK_TREE_VIEW (corr->variables));
 
-  if  (gtk_tree_model_iter_n_children (liststore, NULL) >= 1)
+  if  (gtk_tree_model_iter_n_children (liststore, NULL) > 1)
     return TRUE;
 
   return FALSE;
@@ -83,13 +83,12 @@ dialog_state_valid (gpointer data)
 
 /* Pops up the Correlation dialog box */
 void
-correlation_dialog (GObject *o, gpointer data)
+correlation_dialog (PsppireDataWindow *de)
 {
   struct correlation rd;
   gint response;
 
   GtkBuilder *xml = builder_new ("correlation.ui");
-  PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data);
   PsppireVarStore *vs;
 
   GtkWidget *dialog = get_widget_assert   (xml, "correlation-dialog");
@@ -131,7 +130,7 @@ correlation_dialog (GObject *o, gpointer data)
     case PSPPIRE_RESPONSE_PASTE:
       {
        gchar *syntax = generate_syntax (&rd);
-        paste_syntax_in_new_window (syntax);
+        paste_syntax_to_window (syntax);
 
        g_free (syntax);
       }