if (var_has_value_labels (var) && GTK_IS_COMBO_BOX (editable))
{
const struct val_labs *labels = var_get_value_labels (var);
- const struct val_lab *vl;
+ const struct val_lab **vls = val_labs_sorted (labels);
+ size_t n_vls = val_labs_count (labels);
GtkListStore *list_store;
+ int i;
list_store = gtk_list_store_new (1, G_TYPE_STRING);
- for (vl = val_labs_first (labels); vl != NULL;
- vl = val_labs_next (labels, vl))
+ for (i = 0; i < n_vls; ++i)
{
+ const struct val_lab *vl = vls[i];
GtkTreeIter iter;
gtk_list_store_append (list_store, &iter);
0, val_lab_get_label (vl),
-1);
}
+ free (vls);
gtk_combo_box_set_model (GTK_COMBO_BOX (editable),
GTK_TREE_MODEL (list_store));
g_assert_not_reached ();
}
- gtk_selection_data_set (selection_data, selection_data->target,
+ gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
8,
(const guchar *) string->str, string->len);
gint first_column;
char *c;
- if ( sd->length < 0 )
+ if ( gtk_selection_data_get_length (sd) < 0 )
return;
- if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE))
+ if ( gtk_selection_data_get_data_type (sd) != gdk_atom_intern ("UTF8_STRING", FALSE))
return;
- c = (char *) sd->data;
+ c = (char *) gtk_selection_data_get_data (sd);
/* Get the starting selected position in the data sheet. (Possibly we should
only paste into the selected range if it's larger than one cell?) */
g_return_if_fail (next_row >= 0);
g_return_if_fail (next_column >= 0);
- while (count < sd->length)
+ while (count < gtk_selection_data_get_length (sd))
{
gint row = next_row;
gint column = next_column;
struct variable *var;
char *s = c;
- while (*c != '\t' && *c != '\n' && count < sd->length)
+ while (*c != '\t' && *c != '\n' && count < gtk_selection_data_get_length (sd))
{
c++;
count++;