my_casereader_class.destroy = my_destroy;
my_casereader_class.advance = my_advance;
- struct caseproto *proto = caseproto_create ();
- int i;
-
- struct fmt_guesser **fg = xcalloc (sizeof *fg, dict_get_var_cnt (ia->dict));
- for (i = 0 ; i < dict_get_var_cnt (ia->dict); ++i)
- {
- fg[i] = fmt_guesser_create ();
- }
+ {
+ int i;
- gint n_rows = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (ia->delimiters_model), NULL);
+ struct fmt_guesser **fg = xcalloc (sizeof *fg, dict_get_var_cnt (ia->dict));
+ for (i = 0 ; i < dict_get_var_cnt (ia->dict); ++i)
+ {
+ fg[i] = fmt_guesser_create ();
+ }
- GtkTreeIter iter;
- gboolean ok;
- for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ia->delimiters_model), &iter);
- ok;
- ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (ia->delimiters_model), &iter))
- {
- for (i = 0 ; i < dict_get_var_cnt (ia->dict); ++i)
- {
- gchar *s = NULL;
- gtk_tree_model_get (GTK_TREE_MODEL (ia->delimiters_model), &iter, i+1, &s, -1);
- if (s)
- fmt_guesser_add (fg[i], ss_cstr (s));
- free (s);
- }
- }
+ gint n_rows = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (ia->delimiters_model), NULL);
- for (i = 0 ; i < dict_get_var_cnt (ia->dict); ++i)
- {
- struct fmt_spec fs;
- fmt_guesser_guess (fg[i], &fs);
+ GtkTreeIter iter;
+ gboolean ok;
+ for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (ia->delimiters_model), &iter);
+ ok;
+ ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (ia->delimiters_model), &iter))
+ {
+ for (i = 0 ; i < dict_get_var_cnt (ia->dict); ++i)
+ {
+ gchar *s = NULL;
+ gtk_tree_model_get (GTK_TREE_MODEL (ia->delimiters_model), &iter, i+1, &s, -1);
+ if (s)
+ fmt_guesser_add (fg[i], ss_cstr (s));
+ free (s);
+ }
+ }
- fmt_fix (&fs, FMT_FOR_INPUT);
+ struct caseproto *proto = caseproto_create ();
+ for (i = 0 ; i < dict_get_var_cnt (ia->dict); ++i)
+ {
+ struct fmt_spec fs;
+ fmt_guesser_guess (fg[i], &fs);
- struct variable *var = dict_get_var (ia->dict, i);
+ fmt_fix (&fs, FMT_FOR_INPUT);
- int width = fmt_var_width (&fs);
+ struct variable *var = dict_get_var (ia->dict, i);
- var_set_width_and_formats (var, width,
- &fs, &fs);
+ int width = fmt_var_width (&fs);
- proto = caseproto_add_width (proto, width);
- fmt_guesser_destroy (fg[i]);
- }
+ var_set_width_and_formats (var, width,
+ &fs, &fs);
- free (fg);
+ proto = caseproto_add_width (proto, width);
+ fmt_guesser_destroy (fg[i]);
+ }
- struct casereader *reader =
- casereader_create_random (proto, n_rows, &my_casereader_class, ia);
+ free (fg);
- PsppireDataStore *store = psppire_data_store_new (dict);
- psppire_data_store_set_reader (store, reader);
+ struct casereader *reader =
+ casereader_create_random (proto, n_rows, &my_casereader_class, ia);
- g_object_set (ia->data_sheet, "data-model", store, NULL);
+ PsppireDataStore *store = psppire_data_store_new (dict);
+ psppire_data_store_set_reader (store, reader);
+ g_object_set (ia->data_sheet, "data-model", store, NULL);
+ caseproto_unref (proto);
+ }
gint pmax;
g_object_get (get_widget_assert (ia->builder, "vpaned1"),