From 12b9efe4bcd6ef6e5a87df9108e4ba49182730b4 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 24 Feb 2023 19:01:15 -0800 Subject: [PATCH] pivot-table: Force width of weight formats to 40. It was too confusing when output tables contained **** because of weight variables with narrow widths. Recently reported by Andreas Hammer. I've also noticed the same thing myself. --- src/output/pivot-table.c | 4 ++-- src/output/pivot-table.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index c6197beb04..213cfc028c 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -1375,9 +1375,9 @@ pivot_table_set_weight_var (struct pivot_table *table, format for the dictionary whose data or statistics are being put into TABLE. */ void -pivot_table_set_weight_format (struct pivot_table *table, - const struct fmt_spec wfmt) +pivot_table_set_weight_format (struct pivot_table *table, struct fmt_spec wfmt) { + wfmt.w = 40; table->weight_format = wfmt; } diff --git a/src/output/pivot-table.h b/src/output/pivot-table.h index c52c7654b1..6fd97e19c8 100644 --- a/src/output/pivot-table.h +++ b/src/output/pivot-table.h @@ -576,8 +576,7 @@ void pivot_table_set_look (struct pivot_table *, /* Format of PIVOT_RC_COUNT cells. */ void pivot_table_set_weight_var (struct pivot_table *, const struct variable *); -void pivot_table_set_weight_format (struct pivot_table *, - const struct fmt_spec); +void pivot_table_set_weight_format (struct pivot_table *, struct fmt_spec); /* Query. */ bool pivot_table_is_empty (const struct pivot_table *); -- 2.30.2