From 287505be96076e1571e609bf4bf1fad99c53fb53 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 3 Jun 2022 16:39:59 -0700 Subject: [PATCH] VLABELS --- src/language/stats/ctables.c | 7 ++++++- tests/language/stats/ctables.at | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/language/stats/ctables.c b/src/language/stats/ctables.c index e34621e2fa..4f231caa7a 100644 --- a/src/language/stats/ctables.c +++ b/src/language/stats/ctables.c @@ -3405,6 +3405,7 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t) } type; + enum settings_value_show vlabel; /* CTL_VAR only. */ size_t var_idx; }; struct ctables_level *levels = xnmalloc (1 + 2 * max_depth, sizeof *levels); @@ -3416,6 +3417,7 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t) { levels[n_levels++] = (struct ctables_level) { .type = CTL_VAR, + .vlabel = (enum settings_value_show) vlabel, .var_idx = k, }; } @@ -3511,7 +3513,10 @@ ctables_table_output (struct ctables *ct, struct ctables_table *t) const struct variable *var = nest->vars[level->var_idx]; struct pivot_value *label; if (level->type == CTL_VAR) - label = pivot_value_new_variable (var); + { + label = pivot_value_new_variable (var); + label->variable.show = level->vlabel; + } else if (level->type == CTL_CATEGORY) { const struct ctables_cell_value *cv = &cell->axes[a].cvs[level->var_idx]; diff --git a/tests/language/stats/ctables.at b/tests/language/stats/ctables.at index 34f2605b40..abc18bbb12 100644 --- a/tests/language/stats/ctables.at +++ b/tests/language/stats/ctables.at @@ -34,7 +34,7 @@ dnl - FORMAT: dnl * MINCOLWIDTH, MAXCOLWIDTH, UNITS. dnl * EMPTY. dnl * MISSING. -dnl - VLABELS. +dnl - Test VLABELS. dnl - SMISSING (see documentation). dnl - Test WEIGHT and adjustment weights. dnl - Test PCOMPUTE and PPROPERTIES. -- 2.30.2