X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftable.c;h=04181e44f709b9ca1d2fcb9cab3abcce207b9595;hb=89306c3c6b335e23a09bc2c3442d8b08e60cb328;hp=97d16117324b3a91a7152728203b4e12dc20273e;hpb=729b96a6bd9342c45e6f65a113fd87c70da85b0a;p=pspp-builds.git diff --git a/src/output/table.c b/src/output/table.c index 97d16117..04181e44 100644 --- a/src/output/table.c +++ b/src/output/table.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -518,7 +519,8 @@ tab_natural_dimensions (struct tab_table *t, struct outp_driver *d, from V, displayed with format spec F. */ void tab_value (struct tab_table *table, int c, int r, unsigned char opt, - const union value *v, const struct fmt_spec *f) + const union value *v, const struct dictionary *dict, + const struct fmt_spec *f) { char *contents; @@ -537,7 +539,7 @@ tab_value (struct tab_table *table, int c, int r, unsigned char opt, } #endif - contents = data_out_pool (v, "FIXME", f, table->container); + contents = data_out_pool (v, dict_get_encoding (dict), f, table->container); table->cc[c + r * table->cf] = ss_cstr (contents); table->ct[c + r * table->cf] = opt; @@ -578,7 +580,7 @@ tab_fixed (struct tab_table *table, int c, int r, unsigned char opt, #endif double_value.f = val; - s = data_out_pool (&double_value, "FIXME", &f, table->container); + s = data_out_pool (&double_value, LEGACY_NATIVE, &f, table->container); cp = s; while (isspace ((unsigned char) *cp) && cp < &s[w]) @@ -597,9 +599,7 @@ void tab_double (struct tab_table *table, int c, int r, unsigned char opt, double val, const struct fmt_spec *fmt) { - int w; - char *s, *cp; - + struct substring ss; union value double_value ; assert (table != NULL); @@ -629,16 +629,11 @@ tab_double (struct tab_table *table, int c, int r, unsigned char opt, #endif double_value.f = val; - s = data_out_pool (&double_value, "FIXME", fmt, table->container); + ss = ss_cstr (data_out_pool (&double_value, LEGACY_NATIVE, fmt, table->container)); - cp = s; - while (isspace ((unsigned char) *cp) && cp < s + fmt->w) - { - cp++; - } - w = fmt->w - (cp - s); - - table->cc[c + r * table->cf] = ss_buffer (cp, w); + ss_ltrim (&ss, ss_cstr (" ")); + + table->cc[c + r * table->cf] = ss; table->ct[c + r * table->cf] = opt; }