src/ui/gui/automake.mk: Remove OBSOLETE
[pspp] / src / ui / gui / psppire-output-view.c
index b90c7d76373efa4eeb3b7832f468074928464987..2ac85a52ada2e3418963a86fbab8cb6718fd5865 100644 (file)
@@ -224,13 +224,14 @@ rerender (struct psppire_output_view *view)
   if (!view->n_items || ! gdkw)
     return;
 
+  if (view->xr == NULL)
+    create_xr (view);
+
   GdkWindow *win = gtk_layout_get_bin_window (view->output);
   cairo_region_t *region = gdk_window_get_visible_region (win);
   GdkDrawingContext *ctx =  gdk_window_begin_draw_frame (win, region);
   cairo_t *cr = gdk_drawing_context_get_cairo_context (ctx);
 
-  if (view->xr == NULL)
-    create_xr (view);
   view->y = 0;
   view->max_width = 0;
   for (item = view->items; item < &view->items[view->n_items]; item++)
@@ -343,13 +344,13 @@ psppire_output_view_put (struct psppire_output_view *view,
     {
       view_item->drawing_area = drawing_area = gtk_drawing_area_new ();
 
+      if (view->xr == NULL)
+        create_xr (view);
+
       cairo_region_t *region = gdk_window_get_visible_region (win);
       GdkDrawingContext *ctx = gdk_window_begin_draw_frame (win, region);
       cairo_t *cr = gdk_drawing_context_get_cairo_context (ctx);
 
-      if (view->xr == NULL)
-        create_xr (view);
-
       if (view->y > 0)
         view->y += view->font_height / 2;
 
@@ -533,7 +534,7 @@ clipboard_get_cb (GtkClipboard     *clipboard,
   GList *rows = gtk_tree_selection_get_selected_rows (sel, &model);
   GList *n = rows;
 
-  if ( n == NULL)
+  if (n == NULL)
     return;
 
   if (path_search (dirname, sizeof dirname, NULL, NULL, true)
@@ -591,7 +592,7 @@ clipboard_get_cb (GtkClipboard     *clipboard,
       n = n->next;
     }
 
-  if ( driver->class->flush)
+  if (driver->class->flush)
     driver->class->flush (driver);
 
 
@@ -600,7 +601,7 @@ clipboard_get_cb (GtkClipboard     *clipboard,
   output_driver_destroy (driver);
   driver = NULL;
 
-  if ( g_file_get_contents (filename, &text, &length, NULL) )
+  if (g_file_get_contents (filename, &text, &length, NULL))
     {
       gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
                              8,
@@ -792,6 +793,9 @@ psppire_output_view_destroy (struct psppire_output_view *view)
 
   xr_driver_destroy (view->xr);
 
+  if (view->cur_group)
+    gtk_tree_path_free (view->cur_group);
+
   free (view);
 }
 
@@ -901,7 +905,7 @@ paginate (GtkPrintOperation *operation,
          complete.  Don't let that screw up printing. */
       return TRUE;
     }
-  else if ( view->print_item < view->n_items )
+  else if (view->print_item < view->n_items)
     {
       xr_driver_output_item (view->print_xrd,
                              view->items[view->print_item++].item);