- struct substring s;
- const struct fmt_spec *print = var_get_print_format (var);
-
- const char *label = var_lookup_value_label (var, v);
- if (label)
- {
- tab_text (table, c, r, TAB_LEFT, label);
- return;
- }
-
- s.string = tab_alloc (table, print->w);
- data_out (v, print, s.string);
- s.length = print->w;
- if (proc->exclude == MV_NEVER && var_is_num_missing (var, v->f, MV_USER))
- s.string[s.length++] = 'M';
- while (s.length && *s.string == ' ')
- {
- s.length--;
- s.string++;
- }
- tab_raw (table, c, r, opt, &s);
-}
-
-/* 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_vars - first_difference - 1, tab_nc (table) - 1, 0);
-
- for (; first_difference >= 2; first_difference--)
- table_value_missing (proc, table, 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 fmt_spec f = {FMT_F, 10, 1};
- union value v;
- struct substring s;
-
- s.length = 10;
- s.string = tab_alloc (table, 16);
- v.f = value;
- data_out (&v, &f, s.string);
- while (*s.string == ' ')
- {
- s.length--;
- s.string++;
- }
- if (suffix != 0)
- s.string[s.length++] = suffix;
- if (mark_missing)
- s.string[s.length++] = 'M';
-
- tab_raw (table, c, r, TAB_RIGHT, &s);