work
[pspp] / tests / output / render-test.c
index 19bb0ccfab5321a8312b015bfe466ec43e5009f6..c382ee12c5ef307e51c03deca6fd3cc4f98f5e71 100644 (file)
@@ -25,6 +25,7 @@
 #include "data/file-handle-def.h"
 #include "libpspp/assertion.h"
 #include "libpspp/compiler.h"
+#include "libpspp/i18n.h"
 #include "libpspp/string-map.h"
 #include "output/ascii.h"
 #include "output/driver.h"
@@ -76,6 +77,7 @@ main (int argc, char **argv)
   FILE *input;
 
   set_program_name (argv[0]);
+  i18n_init ();
   output_engine_push ();
   input_file_name = parse_options (argc, argv);
 
@@ -112,7 +114,7 @@ main (int argc, char **argv)
         }
 
       table = tables[n_tables - 1];
-      table_item_submit (table_item_create (table, NULL, NULL));
+      table_item_submit (table_item_create (table));
       free (tables);
     }
   else
@@ -411,13 +413,15 @@ read_table (FILE *stream)
               cs = 1;
             }
 
-#define S(H) { AREA_STYLE_INITIALIZER__, .cell_style.halign = H }
-          static const struct area_style left_style = S (TABLE_HALIGN_LEFT);
-          static const struct area_style right_style = S (TABLE_HALIGN_RIGHT);
-          static const struct area_style center_style
+#define S(H) { TABLE_AREA_STYLE_INITIALIZER__, .cell_style.halign = H }
+          static const struct table_area_style left_style
+            = S (TABLE_HALIGN_LEFT);
+          static const struct table_area_style right_style
+            = S (TABLE_HALIGN_RIGHT);
+          static const struct table_area_style center_style
             = S (TABLE_HALIGN_CENTER);
 
-          const struct area_style *style = &right_style;
+          const struct table_area_style *style = &right_style;
           while (*text && strchr ("<>^,@()|", *text))
             switch (*text++)
               {
@@ -469,14 +473,16 @@ read_table (FILE *stream)
               {
                 table_joint_text (tab, c, r, c + cs - 1, r + rs - 1, 0,
                                   content);
-                table_add_style (tab, c, r, style);
+                table_add_style (tab, c, r,
+                                 CONST_CAST (struct table_area_style *,
+                                             style));
               }
             else
               {
                 char marker[2] = { 'a' + n_footnotes, '\0' };
                 struct footnote *f = table_create_footnote (
                   tab, n_footnotes, content, marker,
-                  area_style_clone (tab->container, &left_style));
+                  table_area_style_clone (tab->container, &left_style));
                 table_add_footnote (tab, c, r, f);
                 n_footnotes++;
               }