GtkSelectionData: only access using functions
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 26 May 2013 13:28:51 +0000 (15:28 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 28 May 2013 14:03:54 +0000 (16:03 +0200)
src/ui/gui/psppire-data-sheet.c
src/ui/gui/psppire-syntax-window.c

index 279c36953efcb668564fdfd5a92a784e7af246ce..3da9e0455068d68e94826a26279530e312430d48 100644 (file)
@@ -2305,7 +2305,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 +2438,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 +2458,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++;
index 854ff700bd0dd81692c3dc4ffbd7657c78a286a7..2402b341c117d0c831c47755aef8f97a0c6ebb47 100644 (file)
@@ -296,7 +296,7 @@ clipboard_get_cb (GtkClipboard     *clipboard,
   PsppireSyntaxWindow *sw = data;
   g_assert (info == SELECT_FMT_TEXT);
 
-  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 *) sw->cliptext, strlen (sw->cliptext));
 
@@ -378,15 +378,15 @@ contents_received_callback (GtkClipboard *clipboard,
 {
   PsppireSyntaxWindow *syntax_window = data;
 
-  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;
 
   gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (syntax_window->buffer),
-                                   (gchar *) sd->data,
-                                   sd->length);
+                                   (gchar *) gtk_selection_data_get_data (sd),
+                                   gtk_selection_data_get_length (sd));
 
 }
 
@@ -892,11 +892,11 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window)
 
   {
   GtkUIManager *uim = GTK_UI_MANAGER (get_object_assert (xml, "uimanager1", GTK_TYPE_UI_MANAGER));
+  GtkWidget *w = gtk_ui_manager_get_widget (uim,"/ui/menubar/windows/windows_minimise_all");
 
   merge_help_menu (uim);
 
-  PSPPIRE_WINDOW (window)->menu =
-    GTK_MENU_SHELL (gtk_ui_manager_get_widget (uim,"/ui/menubar/windows/windows_minimise_all")->parent);
+  PSPPIRE_WINDOW (window)->menu = GTK_MENU_SHELL (gtk_widget_get_parent (w));
   }
 
   g_object_unref (xml);