it works again
[pspp] / src / output / csv.c
index ab79e32a76c19bcdaa50c86ca5b379cf7d1711de..e6edfc6bfce74401a209a50a3c8b2d96bbecb5cb 100644 (file)
@@ -32,6 +32,7 @@
 #include "output/message-item.h"
 #include "output/page-eject-item.h"
 #include "output/pivot-output.h"
+#include "output/pivot-table.h"
 #include "output/table-item.h"
 #include "output/table-provider.h"
 
@@ -175,13 +176,6 @@ csv_output_lines (struct csv_driver *csv, const char *text_)
     }
 }
 
-static void
-csv_format_footnotes (struct footnote **f, size_t n, struct string *s)
-{
-  for (size_t i = 0; i < n; i++)
-    ds_put_format (s, "[%s]", f[i]->marker);
-}
-
 static void
 csv_output_table_cell (struct csv_driver *csv, const struct table_cell *cell,
                        const char *leader)
@@ -212,7 +206,14 @@ csv_output_table_cell (struct csv_driver *csv, const struct table_cell *cell,
         for (size_t i = 0; i < cell->n_subscripts; i++)
           ds_put_format (&s, "%c%s",
                          i ? ',' : '_', cell->subscripts[i]);
-      csv_format_footnotes (cell->footnotes, cell->n_footnotes, &s);
+      for (size_t i = 0; i < cell->n_footnotes; i++)
+        {
+          ds_put_byte (&s, '[');
+          pivot_value_format (cell->footnotes[i]->marker,
+                              SETTINGS_VALUE_SHOW_DEFAULT,
+                              SETTINGS_VALUE_SHOW_DEFAULT, &s);
+          ds_put_byte (&s, ']');
+        }
       csv_output_field (csv, ds_cstr (&s));
       ds_destroy (&s);