output-item: Collapse the inheritance hierarchy into a single struct.
[pspp] / src / language / data-io / print.c
index 4545a222df0c5f01ae350446d423ac3eafee0bc7..3b5541a3c3e68a62584f2a6ddb8373c2748f8b41 100644 (file)
@@ -41,8 +41,8 @@
 #include "libpspp/pool.h"
 #include "libpspp/u8-line.h"
 #include "output/pivot-table.h"
-#include "output/tab.h"
-#include "output/text-item.h"
+#include "output/table.h"
+#include "output/output-item.h"
 
 #include "gl/xalloc.h"
 
@@ -450,7 +450,7 @@ dump_table (struct print_trns *trns)
                         pivot_value_new_integer (spec->record));
       int last_column = spec->first_column + spec->format.w - 1;
       pivot_table_put2 (table, 1, row, pivot_value_new_user_text_nocopy (
-                          xasprintf ("%3d-%3d",
+                          xasprintf ("%d-%d",
                                      spec->first_column, last_column)));
 
       char fmt_string[FMT_STRING_LEN_MAX + 1];
@@ -504,7 +504,7 @@ print_text_trns_proc (void *trns_, struct ccase **c,
               char *s;
 
               s = data_out (input, var_get_encoding (spec->var),
-                            &spec->format);
+                            &spec->format, settings_get_fmt_settings ());
               len = strlen (s);
               width = u8_width (CHAR_CAST (const uint8_t *, s), len, UTF8);
               x1 = x0 + width;
@@ -555,14 +555,16 @@ print_text_flush_records (struct print_trns *trns, struct u8_line *line,
         {
           *eject = false;
           if (trns->writer == NULL)
-            text_item_submit (text_item_create (TEXT_ITEM_EJECT_PAGE, ""));
+            output_item_submit (page_break_item_create ());
           else
             leader = '1';
         }
       *u8_line_reserve (line, 0, 1, 1) = leader;
 
       if (trns->writer == NULL)
-        tab_output_text (TAB_FIX, ds_cstr (&line->s) + 1);
+        output_item_submit (text_item_create (TEXT_ITEM_LOG,
+                                              ds_cstr (&line->s) + 1,
+                                              NULL));
       else
         {
           size_t len = ds_length (&line->s);
@@ -616,7 +618,8 @@ print_binary_trns_proc (void *trns_, struct ccase **c,
           const union value *input = case_data (*c, spec->var);
           if (!spec->sysmis_as_spaces || input->f != SYSMIS)
             data_out_recode (input, var_get_encoding (spec->var),
-                             &spec->format, &line, trns->encoding);
+                             &spec->format, settings_get_fmt_settings (),
+                             &line, trns->encoding);
           else
             ds_put_byte_multiple (&line, encoded_space, spec->format.w);
           if (spec->add_space)