ascii: Include footnote markers in output.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Jan 2021 02:01:03 +0000 (18:01 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Jan 2021 02:03:09 +0000 (18:03 -0800)
src/output/ascii.c
src/output/pivot-table.c
src/output/pivot-table.h

index 9649236cc855dce05d0d6e7c597b392eeeb0bef4..0efc523d2acd0f7108d1a4083086c5b66d91f797 100644 (file)
@@ -925,7 +925,7 @@ ascii_layout_cell (struct ascii_driver *a, const struct table_cell *cell,
   *heightp = 0;
 
   struct string body = DS_EMPTY_INITIALIZER;
-  bool numeric = pivot_value_format_body (cell->value, a->pt, &body);
+  bool numeric = pivot_value_format (cell->value, a->pt, &body);
 
   /* Calculate length; if it's zero, then there's nothing to do. */
   if (ds_is_empty (&body))
index 37ea5c7a9549599b3892b7bd500acda969ce4f27..369ab63525455ac48090a8ef7932e344f1b49009 100644 (file)
@@ -2403,13 +2403,16 @@ pivot_value_format_body (const struct pivot_value *value,
 /* Appends a text representation of VALUE to OUT.  Settings on
    PT control whether variable and value labels are included.
 
-   Subscripts and footnotes are included. */
-void
+   Subscripts and footnotes are included.
+
+   Returns true if OUT is a number (or a number plus a value label), false
+   otherwise.  */
+bool
 pivot_value_format (const struct pivot_value *value,
                     const struct pivot_table *pt,
                     struct string *out)
 {
-  pivot_value_format_body (value, pt, out);
+  bool numeric = pivot_value_format_body (value, pt, out);
 
   if (value->n_subscripts)
     {
@@ -2427,6 +2430,8 @@ pivot_value_format (const struct pivot_value *value,
 
       ds_put_byte (out, ']');
     }
+
+  return numeric;
 }
 
 /* Returns a text representation of VALUE.  The caller must free the string,
index c6005d38921c683787d37987a7c6c4ed6e138013..0c89725a248e85249577223bffe30bea4c718ae2 100644 (file)
@@ -758,7 +758,7 @@ void pivot_value_set_rc (const struct pivot_table *, struct pivot_value *,
 char *pivot_value_to_string (const struct pivot_value *,
                              const struct pivot_table *);
 char *pivot_value_to_string_defaults (const struct pivot_value *);
-void pivot_value_format (const struct pivot_value *,
+bool pivot_value_format (const struct pivot_value *,
                          const struct pivot_table *, struct string *);
 bool pivot_value_format_body (const struct pivot_value *,
                               const struct pivot_table *,