X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-view.c;h=c71a5e66103e2821814972461c12b46e1de0aa5a;hb=4e3feede0f6b3d2e67d6e41a9ddea3738e574dc3;hp=5ef5b86dac3d706b6e2864b215d2dc1ef25b2d30;hpb=2b4fb7e846d62f1a70656bb42a0f769363ed0832;p=pspp diff --git a/src/ui/gui/psppire-var-view.c b/src/ui/gui/psppire-var-view.c index 5ef5b86dac..c71a5e6610 100644 --- a/src/ui/gui/psppire-var-view.c +++ b/src/ui/gui/psppire-var-view.c @@ -21,6 +21,7 @@ #include "psppire-var-ptr.h" #include "psppire-select-dest.h" +#include #include #include @@ -400,3 +401,33 @@ psppire_var_view_append_names (PsppireVarView *vv, gint column, GString *string) return n_vars; } + + +/* + Append the names of selected variables to STR + Returns the number of variables appended. +*/ +gint +psppire_var_view_append_names_str (PsppireVarView *vv, gint column, struct string *str) +{ + gint n_vars = 0; + GtkTreeIter iter; + + if ( psppire_var_view_get_iter_first (vv, &iter) ) + { + do + { + const struct variable *var = psppire_var_view_get_variable (vv, column, &iter); + ds_put_cstr (str, " "); + ds_put_cstr (str, var_get_name (var)); + + n_vars++; + } + while (psppire_var_view_get_iter_next (vv, &iter)); + } + + return n_vars; +} + + +