Fix bug #20910.
[pspp-builds.git] / src / ui / gui / psppire-dict.c
index 31761136f8654601906ccd050aec107e8f59280f..8560c223f1236b0b7de9d4904b55c4e1b0358b3e 100644 (file)
@@ -411,6 +411,17 @@ psppire_dict_get_var_cnt (const PsppireDict *d)
 }
 
 
+/* Return the number of `union value's in the dictionary */
+size_t
+psppire_dict_get_value_cnt (const PsppireDict *d)
+{
+  g_return_val_if_fail (d, -1);
+  g_return_val_if_fail (d->dict, -1);
+
+  return dict_get_next_value_idx (d->dict);
+}
+
+
 /* Return a variable by name.
    Return NULL if it doesn't exist
 */
@@ -781,17 +792,14 @@ psppire_dict_dump (const PsppireDict *dict)
   gint i;
   const struct dictionary *d = dict->dict;
 
-  int *map = dict_get_compacted_dict_index_to_case_index (d);
-
   for (i = 0; i < dict_get_var_cnt (d); ++i)
     {
       const struct variable *v = psppire_dict_get_variable (dict, i);
       int di = var_get_dict_index (v);
-      g_print ("\"%s\" idx=%d, fv=%d(%d), size=%d\n",
+      g_print ("\"%s\" idx=%d, fv=%d, size=%d\n",
               var_get_name(v),
               di,
               var_get_case_index(v),
-              map[di],
               value_cnt_from_width(var_get_width(v)));
 
     }