Merge remote-tracking branch 'origin/master' into gtk3
[pspp] / src / ui / gui / psppire-data-sheet.c
index 279c36953efcb668564fdfd5a92a784e7af246ce..dfb7382da5263bb62e2b535a6cdacbcac09662b5 100644 (file)
@@ -1909,6 +1909,7 @@ on_variable_display_width_changed (PsppireDict *dict, int dict_index,
 
 static void
 on_variable_changed (PsppireDict *dict, int dict_index,
+                    guint what, const struct variable *oldvar,
                      PsppireDataSheet *data_sheet)
 {
   PsppireDataStore *data_store = psppire_data_sheet_get_data_store (data_sheet);
@@ -1921,11 +1922,16 @@ on_variable_changed (PsppireDict *dict, int dict_index,
   g_return_if_fail (data_sheet->data_store != NULL);
   g_return_if_fail (dict == data_sheet->data_store->dict);
 
+
+  if (what & VAR_TRAIT_DISPLAY_WIDTH)
+    on_variable_display_width_changed (dict, dict_index, data_sheet);
+
   column = psppire_data_sheet_find_column_for_variable (data_sheet,
                                                         dict_index);
   if (column == NULL)
     return;
 
+
   var = psppire_dict_get_variable (data_store->dict, dict_index);
   g_return_if_fail (var != NULL);
 
@@ -2045,9 +2051,6 @@ psppire_data_sheet_set_data_store (PsppireDataSheet *data_sheet,
       g_signal_connect (data_store->dict, "variable-changed",
                         G_CALLBACK (on_variable_changed),
                         data_sheet);
-      g_signal_connect (data_store->dict, "variable-display-width-changed",
-                        G_CALLBACK (on_variable_display_width_changed),
-                        data_sheet);
       g_signal_connect (data_store->dict, "variable-inserted",
                         G_CALLBACK (on_variable_inserted), data_sheet);
       g_signal_connect (data_store->dict, "variable-deleted",
@@ -2305,7 +2308,7 @@ psppire_data_sheet_clipboard_set (GtkSelectionData *selection_data,
       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);
 
@@ -2438,13 +2441,13 @@ psppire_data_sheet_clip_received_cb (GtkClipboard *clipboard,
   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?) */
@@ -2458,14 +2461,14 @@ psppire_data_sheet_clip_received_cb (GtkClipboard *clipboard,
   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++;