X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdictionary%2Fsplit-file.c;h=d27ab3a65b3ab1b34c6c74b9a8cb1b011287a7a2;hb=c1a56a1dd2afad462cf76d91c40aa064cc7dce04;hp=5d3650e3b3de569bd6e3eee5e1ff30d3ffddd267;hpb=7878e5e2f2d1045bba2483ab9a752ceae50086f3;p=pspp-builds.git diff --git a/src/language/dictionary/split-file.c b/src/language/dictionary/split-file.c index 5d3650e3..d27ab3a6 100644 --- a/src/language/dictionary/split-file.c +++ b/src/language/dictionary/split-file.c @@ -31,8 +31,7 @@ #include #include #include -#include -#include +#include #include "xalloc.h" @@ -78,7 +77,6 @@ output_split_file_values (const struct dataset *ds, const struct ccase *c) return; t = tab_create (3, split_cnt + 1); - tab_dim (t, tab_natural_dimensions, NULL, NULL); tab_vline (t, TAL_GAP, 1, 0, split_cnt); tab_vline (t, TAL_GAP, 2, 0, split_cnt); tab_text (t, 0, 0, TAB_NONE, _("Variable")); @@ -88,21 +86,21 @@ output_split_file_values (const struct dataset *ds, const struct ccase *c) for (i = 0; i < split_cnt; i++) { const struct variable *v = split[i]; - char temp_buf[80]; + char *s; const char *val_lab; const struct fmt_spec *print = var_get_print_format (v); tab_text_format (t, 0, i + 1, TAB_LEFT, "%s", var_get_name (v)); - data_out (case_data (c, v), print, temp_buf); - temp_buf[print->w] = 0; + s = data_out (case_data (c, v), dict_get_encoding (dict), print); - tab_text_format (t, 1, i + 1, 0, "%.*s", print->w, temp_buf); + tab_text_format (t, 1, i + 1, 0, "%.*s", print->w, s); + free (s); + val_lab = var_lookup_value_label (v, case_data (c, v)); if (val_lab) tab_text (t, 2, i + 1, TAB_LEFT, val_lab); } - tab_flags (t, SOMF_NO_TITLE); tab_submit (t); }