pivot-table: Force width of weight formats to 40.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 25 Feb 2023 03:01:15 +0000 (19:01 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 25 Feb 2023 03:01:51 +0000 (19:01 -0800)
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
src/output/pivot-table.h

index c6197beb04dde747307cc757169b00836f69a8cc..213cfc028cc4ef81f70e9d21d003faccb45f4246 100644 (file)
@@ -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;
 }
 
index c52c7654b1c7c0e17a43ab3612151263d39db667..6fd97e19c8955b571ff4472ead6ca0707d955aca 100644 (file)
@@ -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 *);