Fix critical when opening fonts dialog
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 13 Mar 2009 03:52:51 +0000 (12:52 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 13 Mar 2009 03:52:51 +0000 (12:52 +0900)
src/ui/gui/psppire-data-window.c

index 5d35551a09345598c020c72a4c10e560de359b46..c754f73038f69e49238b2c881e004f7f65a0c4ad 100644 (file)
@@ -690,6 +690,7 @@ static void
 fonts_activate (GtkMenuItem *menuitem, gpointer data)
 {
   PsppireDataWindow  *de = PSPPIRE_DATA_WINDOW (data);
+  GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (de));
   PangoFontDescription *current_font;
   gchar *font_name;
   GtkWidget *dialog =
@@ -704,8 +705,8 @@ fonts_activate (GtkMenuItem *menuitem, gpointer data)
   g_free (font_name);
 
   gtk_window_set_transient_for (GTK_WINDOW (dialog),
-                               GTK_WINDOW (get_widget_assert (de->builder,
-                                                              "data_editor")));
+                               GTK_WINDOW (toplevel));
+
   if ( GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (dialog)) )
     {
       const gchar *font = gtk_font_selection_dialog_get_font_name