projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crosstabs: Trim unsightly spaces from titles in output.
[pspp-builds.git]
/
src
/
language
/
stats
/
crosstabs.q
diff --git
a/src/language/stats/crosstabs.q
b/src/language/stats/crosstabs.q
index e296da2d61da1e7307238f76772d8071eb6af2fb..907868c0c264c242af4b780cffebe40086314610 100644
(file)
--- a/
src/language/stats/crosstabs.q
+++ b/
src/language/stats/crosstabs.q
@@
-1218,10
+1218,17
@@
create_crosstab_table (struct crosstabs_proc *proc, struct pivot_table *pt)
for (i = 0; i < pt->n_consts; i++)
{
const struct variable *var = pt->const_vars[i];
for (i = 0; i < pt->n_consts; i++)
{
const struct variable *var = pt->const_vars[i];
+ size_t ofs;
+
ds_put_format (&title, ", %s=", var_get_name (var));
ds_put_format (&title, ", %s=", var_get_name (var));
+
+ /* Insert the formatted value of the variable, then trim
+ leading spaces in what was just inserted. */
+ ofs = ds_length (&title);
data_out (&pt->const_values[i], var_get_print_format (var),
ds_put_uninit (&title, var_get_width (var)));
data_out (&pt->const_values[i], var_get_print_format (var),
ds_put_uninit (&title, var_get_width (var)));
- /* XXX remove any leading space in what was just inserted. */
+ ds_remove (&title, ofs, ss_cspan (ds_substr (&title, ofs, SIZE_MAX),
+ ss_cstr (" ")));
}
ds_put_cstr (&title, " [");
}
ds_put_cstr (&title, " [");