- const char *label = var_lookup_value_label (var, v);
- if (label != NULL)
- tab_text (table, c, r, TAB_LEFT, label);
- else
- {
- const struct fmt_spec *print = var_get_print_format (var);
- if (proc->exclude == MV_NEVER && var_is_value_missing (var, v, MV_USER))
- {
- char *s = data_out (v, dict_get_encoding (proc->dict), print);
- tab_text_format (table, c, r, opt, "%sM", s + strspn (s, " "));
- free (s);
- }
- else
- tab_value (table, c, r, opt, v, var, print);
- }
-}
-
-/* Draws a line across TABLE at the current row to indicate the most
- major dimension variable with index FIRST_DIFFERENCE out of N_VARS
- that changed, and puts the values that changed into the table. TB
- and PT must be the corresponding table_entry and crosstab,
- respectively. */
-static void
-display_dimensions (struct crosstabs_proc *proc, struct pivot_table *pt,
- struct tab_table *table, int first_difference)
-{
- tab_hline (table, TAL_1, pt->n_consts + pt->n_vars - first_difference - 1, tab_nc (table) - 1, 0);
-
- for (; first_difference >= 2; first_difference--)
- table_value_missing (proc, table, pt->n_consts + pt->n_vars - first_difference - 1, 0,
- TAB_RIGHT, &pt->entries[0]->values[first_difference],
- pt->vars[first_difference]);
-}
-
-/* Put VALUE into cell (C,R) of TABLE, suffixed with character
- SUFFIX if nonzero. If MARK_MISSING is true the entry is
- additionally suffixed with a letter `M'. */
-static void
-format_cell_entry (struct tab_table *table, int c, int r, double value,
- char suffix, bool mark_missing, const struct dictionary *dict)
-{
- union value v;
- char suffixes[3];
- int suffix_len;
- char *s;
-
- v.f = value;
- s = data_out (&v, dict_get_encoding (dict), settings_get_format ());
-
- suffix_len = 0;
- if (suffix != 0)
- suffixes[suffix_len++] = suffix;
- if (mark_missing)
- suffixes[suffix_len++] = 'M';
- suffixes[suffix_len] = '\0';
-
- tab_text_format (table, c, r, TAB_RIGHT, "%s%s",
- s + strspn (s, " "), suffixes);
-
- free (s);