From: Ben Pfaff Date: Sun, 10 Jan 2021 02:01:03 +0000 (-0800) Subject: ascii: Include footnote markers in output. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4c6ba6fe1a82efa5968584b274bc096ade11d24;p=pspp ascii: Include footnote markers in output. --- diff --git a/src/output/ascii.c b/src/output/ascii.c index 9649236cc8..0efc523d2a 100644 --- a/src/output/ascii.c +++ b/src/output/ascii.c @@ -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)) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index 37ea5c7a95..369ab63525 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -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, diff --git a/src/output/pivot-table.h b/src/output/pivot-table.h index c6005d3892..0c89725a24 100644 --- a/src/output/pivot-table.h +++ b/src/output/pivot-table.h @@ -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 *,