value_destroy (&act->cut_point, width);
value_destroy (&act->grp_val[0], width);
value_destroy (&act->grp_val[1], width);
+ var_unref (act->grp_var);
act->grp_var = NULL;
act->grp_var_width = -1;
}
if (psppire_value_entry_get_value (ve, &val, width))
{
- if (var_is_value_missing (var, &val, MV_SYSTEM))
+ if (var_is_value_missing (var, &val) == MV_SYSTEM)
{
result = TRUE;
}
PsppireDialogAction *da = PSPPIRE_DIALOG_ACTION (act);
const gchar *text = gtk_entry_get_text (entry);
- const struct variable *v = da->dict ? psppire_dict_lookup_var (da->dict, text) : NULL;
+ struct variable *v = da->dict ? psppire_dict_lookup_var (da->dict, text) : NULL;
gtk_widget_set_sensitive (act->define_groups_button, v != NULL);
}
}
- act->grp_var = v;
+ struct variable *old_grp_var = act->grp_var;
+ if (v)
+ act->grp_var = var_ref (v);
+ if (old_grp_var)
+ var_unref (old_grp_var);
act->grp_var_width = v ? var_get_width (v) : -1;
}
struct string strx;
ds_init_empty (&strx);
- syntax_gen_value (&strx, val, var_get_width (act->grp_var),
- var_get_print_format (act->grp_var));
+ struct fmt_spec f = var_get_print_format (act->grp_var);
+ syntax_gen_value (&strx, val, var_get_width (act->grp_var), &f);
g_string_append (str, ds_cstr (&strx));
ds_destroy (&strx);
struct string strx;
ds_init_empty (&strx);
+ struct fmt_spec f = var_get_print_format (act->grp_var);
syntax_gen_value (&strx, &act->grp_val[1], var_get_width (act->grp_var),
- var_get_print_format (act->grp_var));
+ &f);
g_string_append (str, ds_cstr (&strx));
ds_destroy (&strx);