From 01cbd30a9b6d38fae395620d2fcc49052d8e8b0f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 25 May 2014 15:37:15 -0700 Subject: [PATCH] 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. --- src/data/variable.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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. */ -- 2.30.2