From: Friedrich Beckmann Date: Wed, 8 Jul 2020 07:44:55 +0000 (+0200) Subject: gui: render empty string for numeric system missing value X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=273fd32809f3e2ba6e98540966db0da221704c68;p=pspp gui: render empty string for numeric system missing value Numeric cells which contain the system missing value are currently rendered as a number of spaces, a dot and a number of spaces depending on the current variable width and decimal places settings. When the cell is edited, then this string is pretty confusing. With the patch system missing values for numeric variables are rendered as empty strings. Editing the cell is then straightforward and starts with an empty cell. --- diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 012c010fe6..8ac492884c 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -171,6 +171,10 @@ psppire_data_store_string_to_value (GtkTreeModel *model, gint col, gint row, static char * unlabeled_value (PsppireDataStore *store, const struct variable *variable, const union value *val) { + if (var_is_numeric (variable) && + var_is_value_missing (variable, val, MV_SYSTEM)) + return g_strdup (""); + const struct fmt_spec *fmt = var_get_print_format (variable); return data_out (val, psppire_dict_encoding (store->dict), fmt); }