From 740db0af0b2f89b804a0ab15bfa4574a130e63ce Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 19 Oct 2019 05:55:47 +0000 Subject: [PATCH] pivot-table: Also dump sizing info in pivot_table_dump(). --- src/output/pivot-table.c | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index 7745e4e974..bab2a8d6ae 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -1424,6 +1424,40 @@ free_headings (const struct pivot_axis *axis, char ***headings) free (headings); } +static void +pivot_table_sizing_dump (const char *name, const struct pivot_table_sizing *s, + int indentation) +{ + indent (indentation); + printf ("%ss: min=%d, max=%d\n", name, s->range[0], s->range[1]); + if (s->n_widths) + { + indent (indentation + 1); + printf ("%s widths:", name); + for (size_t i = 0; i < s->n_widths; i++) + printf (" %d", s->widths[i]); + printf ("\n"); + } + if (s->n_breaks) + { + indent (indentation + 1); + printf ("break after %ss:", name); + for (size_t i = 0; i < s->n_breaks; i++) + printf (" %zu", s->breaks[i]); + printf ("\n"); + } + if (s->n_keeps) + { + indent (indentation + 1); + printf ("keep %ss together:", name); + for (size_t i = 0; i < s->n_keeps; i++) + printf (" [%zu,%zu]", + s->keeps[i].ofs, + s->keeps[i].ofs + s->keeps[i].n - 1); + printf ("\n"); + } +} + void pivot_table_dump (const struct pivot_table *table, int indentation) { @@ -1447,6 +1481,13 @@ pivot_table_dump (const struct pivot_table *table, int indentation) printf ("date: %s", ctime_r (&table->date, buf)); } + indent (indentation); + printf ("sizing:\n"); + pivot_table_sizing_dump ("column", &table->sizing[TABLE_HORZ], + indentation + 1); + pivot_table_sizing_dump ("row", &table->sizing[TABLE_VERT], + indentation + 1); + indent (indentation); printf ("areas:\n"); for (enum pivot_area area = 0; area < PIVOT_N_AREAS; area++) -- 2.30.2