X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Ffind-dialog.c;h=07b73fe84c93d6cdb9e52f51c60a694f4ba0b0dd;hb=b94025a12799b6826a772731b8f58907dca2cf5c;hp=faeb8f6490578ad703096f40cbce96cce44886a8;hpb=b40baf410822471fbdeeec553693619d60d7c7b6;p=pspp-builds.git diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index faeb8f64..07b73fe8 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -219,7 +219,8 @@ find_dialog (GObject *o, gpointer data) "data-store", &ds, NULL); - fd.dict = vs->dict; + g_object_get (vs, "dictionary", &fd.dict, NULL); + fd.data = ds->datasheet; fd.variable_entry = get_widget_assert (fd.xml, "find-variable-entry"); @@ -241,17 +242,17 @@ find_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - g_object_set (source, "dictionary", fd.dict, + g_object_set (source, "model", fd.dict, "selection-mode", GTK_SELECTION_SINGLE, NULL); - psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - fd.variable_entry, - insert_source_row_into_entry, - is_currently_in_entry, - NULL - ); + psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector), + insert_source_row_into_entry, + NULL + ); + + psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector), + is_currently_in_entry); g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), &fd); @@ -585,8 +586,6 @@ cmptr_value_destroy (struct comparator *cmptr) static struct comparator * value_comparator_create (const struct variable *var, const PsppireDict *dict, const char *target) { - const struct fmt_spec *fmt; - int width ; struct value_comparator *vc = xzalloc (sizeof (*vc)); struct comparator *cmptr = (struct comparator *) vc; @@ -596,12 +595,7 @@ value_comparator_create (const struct variable *var, const PsppireDict *dict, co cmptr->destroy = cmptr_value_destroy; cmptr->dict = dict; - width = var_get_width (var); - fmt = var_get_write_format (var); - - value_init (&vc->pattern, width); - - text_to_value (target, &vc->pattern, dict, *var_get_write_format (var) ); + text_to_value (target, dict, var, &vc->pattern); return cmptr; }