X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fcrosstabs.q;h=8f1e42b430e37f38b8977f1b18bc7a09260562f3;hb=2766c2d47448010527d52dd304213d0bb563dd00;hp=1a6d5691bf9412cdb8214c55d59a218017156451;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp-builds.git diff --git a/src/language/stats/crosstabs.q b/src/language/stats/crosstabs.q index 1a6d5691..8f1e42b4 100644 --- a/src/language/stats/crosstabs.q +++ b/src/language/stats/crosstabs.q @@ -30,28 +30,29 @@ */ #include -#include "message.h" +#include #include #include #include #include -#include "array.h" -#include "alloc.h" -#include "case.h" -#include "dictionary.h" -#include "hash.h" -#include "pool.h" -#include "command.h" -#include "lexer.h" -#include "message.h" -#include "magic.h" -#include "misc.h" -#include "output.h" -#include "str.h" -#include "table.h" -#include "value-labels.h" -#include "variable.h" -#include "procedure.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -59,8 +60,6 @@ /* (headers) */ -#include "debug-print.h" - /* (specification) crosstabs (crs_): *^tables=custom; @@ -808,7 +807,7 @@ make_summary_table (void) int cur_tab = 0; summary = tab_create (7, 3 + nxtab, 1); - tab_title (summary, 0, _("Summary.")); + tab_title (summary, _("Summary.")); tab_headers (summary, 1, 0, 3, 0); tab_joint_text (summary, 1, 0, 6, 0, TAB_CENTER, _("Cases")); tab_joint_text (summary, 1, 1, 2, 1, TAB_CENTER, _("Valid")); @@ -1087,7 +1086,7 @@ output_pivot_table (struct table_entry **pb, struct table_entry **pe, } strcpy (cp, "]."); - tab_title (table, 0, title); + tab_title (table, "%s", title); local_free (title); } @@ -1103,7 +1102,7 @@ output_pivot_table (struct table_entry **pb, struct table_entry **pe, (pe - pb) / n_cols * 3 / 2 * N_CHISQ + 10, 1); tab_headers (chisq, 1 + (nvar - 2), 0, 1, 0); - tab_title (chisq, 0, "Chi-square tests."); + tab_title (chisq, _("Chi-square tests.")); tab_offset (chisq, nvar - 2, 0); tab_text (chisq, 0, 0, TAB_LEFT | TAT_TITLE, _("Statistic")); @@ -1129,7 +1128,7 @@ output_pivot_table (struct table_entry **pb, struct table_entry **pe, { sym = tab_create (6 + (nvar - 2), (pe - pb) / n_cols * 7 + 10, 1); tab_headers (sym, 2 + (nvar - 2), 0, 1, 0); - tab_title (sym, 0, "Symmetric measures."); + tab_title (sym, _("Symmetric measures.")); tab_offset (sym, nvar - 2, 0); tab_text (sym, 0, 0, TAB_LEFT | TAT_TITLE, _("Category")); @@ -1148,11 +1147,11 @@ output_pivot_table (struct table_entry **pb, struct table_entry **pe, { risk = tab_create (4 + (nvar - 2), (pe - pb) / n_cols * 4 + 10, 1); tab_headers (risk, 1 + nvar - 2, 0, 2, 0); - tab_title (risk, 0, "Risk estimate."); + tab_title (risk, _("Risk estimate.")); tab_offset (risk, nvar - 2, 0); tab_joint_text (risk, 2, 0, 3, 0, TAB_CENTER | TAT_TITLE | TAT_PRINTF, - _(" 95%% Confidence Interval")); + _("95%% Confidence Interval")); tab_text (risk, 0, 1, TAB_LEFT | TAT_TITLE, _("Statistic")); tab_text (risk, 1, 1, TAB_RIGHT | TAT_TITLE, _("Value")); tab_text (risk, 2, 1, TAB_RIGHT | TAT_TITLE, _("Lower")); @@ -1170,7 +1169,7 @@ output_pivot_table (struct table_entry **pb, struct table_entry **pe, { direct = tab_create (7 + (nvar - 2), (pe - pb) / n_cols * 7 + 10, 1); tab_headers (direct, 3 + (nvar - 2), 0, 1, 0); - tab_title (direct, 0, "Directional measures."); + tab_title (direct, _("Directional measures.")); tab_offset (direct, nvar - 2, 0); tab_text (direct, 0, 0, TAB_LEFT | TAT_TITLE, _("Category")); @@ -1465,7 +1464,7 @@ submit (struct tab_table *t) 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_1 | TAL_SPACING, 0, tab_t (t), tab_l (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); @@ -1480,14 +1479,20 @@ crosstabs_dim (struct tab_table *t, struct outp_driver *d) int i; /* Width of a numerical column. */ - int c = outp_string_width (d, "0.000000"); + int c = outp_string_width (d, "0.000000", OUTP_PROPORTIONAL); if (cmd.miss == CRS_REPORT) - c += outp_string_width (d, "M"); + c += outp_string_width (d, "M", OUTP_PROPORTIONAL); /* Set width for header columns. */ if (t->l != 0) { - int w = (d->width - t->vr_tot - c * (t->nc - t->l)) / t->l; + 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;