#include <data/data-out.h>
#include <data/format.h>
#include <data/value.h>
+#include <data/dictionary.h>
#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
#include <libpspp/misc.h>
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;
}
#endif
- contents = data_out_pool (v, 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;
#endif
double_value.f = val;
- s = data_out_pool (&double_value, &f, table->container);
+ s = data_out_pool (&double_value, LEGACY_NATIVE, &f, table->container);
cp = s;
while (isspace ((unsigned char) *cp) && cp < &s[w])
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);
#endif
double_value.f = val;
- s = data_out_pool (&double_value, 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;
}