output-item: Collapse the inheritance hierarchy into a single struct.
[pspp] / src / ui / gui / psppire-window.c
index 15f8503de26589aba8b82de8bcccdce830b8a01e..4b40f94d1e04e0a055a58703ad21d47b66adfc8a 100644 (file)
@@ -32,7 +32,7 @@
 #include "data/file-handle-def.h"
 #include "data/dataset.h"
 #include "libpspp/version.h"
-#include "output/group-item.h"
+#include "output/output-item.h"
 #include "output/pivot-table.h"
 #include "output/spv/spv.h"
 #include "output/spv/spv-output.h"
@@ -763,10 +763,11 @@ dump_heading_transition (const struct spv_item *old,
       break;
 
   for (size_t i = common; i < old_path.n; i++)
-    group_close_item_submit (group_close_item_create ());
+    output_item_submit (group_close_item_create ());
   for (size_t i = common; i < new_path.n; i++)
-    group_open_item_submit (group_open_item_create (
-                              new_path.nodes[i]->command_id));
+    output_item_submit (group_open_item_create (
+                              new_path.nodes[i]->command_id,
+                              new_path.nodes[i]->label));
 
   free_path (&old_path);
   free_path (&new_path);
@@ -796,7 +797,13 @@ read_spv_file (const char *filename)
       if (items[i]->type == SPV_ITEM_TEXT)
         spv_text_submit (items[i]);
       else if (items[i]->type == SPV_ITEM_TABLE)
-        pivot_table_submit (spv_item_get_table (items[i]));
+        pivot_table_submit (pivot_table_ref (spv_item_get_table (items[i])));
+      else if (items[i]->type == SPV_ITEM_IMAGE)
+        {
+          cairo_surface_t *image = spv_item_get_image (items[i]);
+          output_item_submit (image_item_create (cairo_surface_reference (
+                                                   image)));
+        }
       prev_heading = heading;
     }
   dump_heading_transition (prev_heading, spv_get_root (spv));