+ gboolean ok;
+ GtkTreeIter iter;
+ gboolean retval = TRUE;
+
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (source));
+
+ PsppireDict *dict;
+ GtkTreeSelection *selection;
+ enum val_type type = -1;
+ GList *list, *l;
+
+ while (GTK_IS_TREE_MODEL_FILTER (model))
+ {
+ model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
+ }
+
+ dict = PSPPIRE_DICT (model);
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (source));
+
+ list = gtk_tree_selection_get_selected_rows (selection, &model);
+
+ /* Iterate through the selection of the source treeview */
+ for (l = list; l ; l = l->next)
+ {
+ GtkTreePath *path = l->data;
+
+ GtkTreePath *fpath =
+ gtk_tree_model_filter_convert_path_to_child_path (GTK_TREE_MODEL_FILTER (model), path);
+
+ gint *idx = gtk_tree_path_get_indices (fpath);
+
+ const struct variable *v = psppire_dict_get_variable (dict, idx[0]);
+
+ gtk_tree_path_free (fpath);