projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spv-writer: Consistently use label from output_item.
[pspp]
/
src
/
data
/
variable.c
diff --git
a/src/data/variable.c
b/src/data/variable.c
index 2b0dd2579dc49c39a228755faff72fb57b060a9b..4859b1303faa3b31e737909c18003b59bbb81fd7 100644
(file)
--- a/
src/data/variable.c
+++ b/
src/data/variable.c
@@
-307,17
+307,15
@@
var_set_width_and_formats (struct variable *v, int new_width,
ov = var_clone (v);
ov = var_clone (v);
- if (var_has_missing_values (v))
+ if (mv_is_resizable (&v->miss, new_width))
+ mv_resize (&v->miss, new_width);
+ else
{
{
- if (mv_is_resizable (&v->miss, new_width))
- mv_resize (&v->miss, new_width);
- else
- {
- mv_destroy (&v->miss);
- mv_init (&v->miss, new_width);
- }
- traits |= VAR_TRAIT_MISSING_VALUES;
+ mv_destroy (&v->miss);
+ mv_init (&v->miss, new_width);
}
}
+ if (new_width != var_get_width (v))
+ traits |= VAR_TRAIT_MISSING_VALUES;
if (v->val_labs != NULL)
{
if (v->val_labs != NULL)
{
@@
-574,7
+572,8
@@
static void
append_value (const struct variable *v, const union value *value,
struct string *str)
{
append_value (const struct variable *v, const union value *value,
struct string *str)
{
- char *s = data_out (value, var_get_encoding (v), &v->print);
+ char *s = data_out (value, var_get_encoding (v), &v->print,
+ settings_get_fmt_settings ());
struct substring ss = ss_cstr (s);
ss_rtrim (&ss, ss_cstr (" "));
ds_put_substring (str, ss);
struct substring ss = ss_cstr (s);
ss_rtrim (&ss, ss_cstr (" "));
ds_put_substring (str, ss);