From: John Darrington Date: Fri, 22 Sep 2017 11:55:43 +0000 (+0200) Subject: PsppireDataStore (myreversefunc): Insert variables if attempting to access variable... X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=40c169c1409b0f16e6ee8f0ceaa0ce6937c90a5c PsppireDataStore (myreversefunc): Insert variables if attempting to access variable beyond the last --- diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index d0322204e4..04b6da0858 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -136,6 +136,15 @@ myreversefunc (GtkTreeModel *model, gint col, gint row, { PsppireDataStore *store = PSPPIRE_DATA_STORE (model); + while (col >= psppire_dict_get_var_cnt (store->dict)) + { + const struct variable *var = + psppire_dict_insert_variable (store->dict, + psppire_dict_get_var_cnt (store->dict), + NULL); + g_return_val_if_fail (var, FALSE); + } + const struct variable *variable = psppire_dict_get_variable (store->dict, col); g_return_val_if_fail (variable, FALSE);