From: Ben Pfaff Date: Fri, 3 Jun 2022 23:39:59 +0000 (-0700) Subject: VLABELS X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=1009b87e0b1a2f9a8273033ba4e34c3cbb9d1540 VLABELS --- 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.