From: Ben Pfaff Date: Sun, 25 May 2014 22:37:15 +0000 (-0700) Subject: variable: Report only changes in width that actually change it. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=01cbd30a9b6d38fae395620d2fcc49052d8e8b0f variable: Report only changes in width that actually change it. For me, this fixes the problem reported by Fran A. when I resize the width of the second variable in a data file provided by John Darrington. --- diff --git a/src/data/variable.c b/src/data/variable.c index 8758af35b4..971154368c 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -967,12 +967,14 @@ var_set_display_width_quiet (struct variable *v, int new_width) void var_set_display_width (struct variable *v, int new_width) { - struct variable *ov = var_clone (v); - var_set_display_width_quiet (v, new_width); - dict_var_changed (v, VAR_TRAIT_DISPLAY_WIDTH, ov); + if (v->display_width != new_width) + { + struct variable *ov = var_clone (v); + var_set_display_width_quiet (v, new_width); + dict_var_changed (v, VAR_TRAIT_DISPLAY_WIDTH, ov); + } } - /* Returns the default display width for a variable of the given WIDTH, as set by var_create. The return value can be used to reset a variable's display width to the default. */