-/* Prepare table T for submission, and submit it. */
-static void
-submit (struct crosstabs_proc *proc, struct pivot_table *pt,
- struct tab_table *t)
-{
- int i;
-
- if (t == NULL)
- return;
-
- tab_resize (t, -1, 0);
- if (tab_nr (t) == tab_t (t))
- {
- tab_destroy (t);
- return;
- }
- tab_offset (t, 0, 0);
- if (pt != NULL)
- for (i = 2; i < pt->n_vars; i++)
- tab_text (t, pt->n_vars - i - 1, 0, TAB_RIGHT | TAT_TITLE,
- var_to_string (pt->vars[i]));
- tab_box (t, TAL_2, TAL_2, -1, -1, 0, 0, tab_nc (t) - 1, tab_nr (t) - 1);
- tab_box (t, -1, -1, -1, TAL_1, tab_l (t), tab_t (t) - 1, tab_nc (t) - 1,
- tab_nr (t) - 1);
- tab_box (t, -1, -1, -1, TAL_GAP, 0, tab_t (t), tab_l (t) - 1,
- tab_nr (t) - 1);
- tab_vline (t, TAL_2, tab_l (t), 0, tab_nr (t) - 1);
- tab_dim (t, crosstabs_dim, proc);
- tab_submit (t);
-}
-
-/* Sets the widths of all the columns and heights of all the rows in
- table T for driver D. */
-static void
-crosstabs_dim (struct tab_table *t, struct outp_driver *d, void *proc_)
-{
- struct crosstabs_proc *proc = proc_;
- int i;
-
- /* Width of a numerical column. */
- int c = outp_string_width (d, "0.000000", OUTP_PROPORTIONAL);
- if (proc->exclude == MV_NEVER)
- c += outp_string_width (d, "M", OUTP_PROPORTIONAL);
-
- /* Set width for header columns. */
- if (t->l != 0)
- {
- size_t i;
- int w;
-
- w = d->width - c * (t->nc - t->l);
- for (i = 0; i <= t->nc; i++)
- w -= t->wrv[i];
- w /= t->l;
-
- if (w < d->prop_em_width * 8)
- w = d->prop_em_width * 8;
-
- if (w > d->prop_em_width * 15)
- w = d->prop_em_width * 15;
-
- for (i = 0; i < t->l; i++)
- t->w[i] = w;
- }
-
- for (i = t->l; i < t->nc; i++)
- t->w[i] = c;
-
- for (i = 0; i < t->nr; i++)
- t->h[i] = tab_natural_height (t, d, i);
-}
-