[gtk+/refactor: 97/145] gtk/gtksizerequest.c: use accessor functions to access GtkWidget



commit ca1f2a5626eca7066a3d1800ff150f7bf135c566
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Aug 11 23:00:46 2010 +0200

    gtk/gtksizerequest.c: use accessor functions to access GtkWidget

 gtk/gtksizerequest.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 81c66f6..bfd2d15 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -207,13 +207,17 @@ get_cache (GtkSizeRequest *widget,
 static void
 do_size_request (GtkWidget *widget)
 {
+  GtkRequisition requisition;
+
   if (GTK_WIDGET_REQUEST_NEEDED (widget))
     {
       gtk_widget_ensure_style (widget);
       GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED);
+      gtk_widget_get_requisition (widget, &requisition);
       g_signal_emit_by_name (widget,
                              "size-request",
-                             &widget->requisition);
+                             &requisition);
+      _gtk_widget_set_requisition (widget, &requisition);
     }
 }
 
@@ -262,15 +266,17 @@ compute_size_for_orientation (GtkSizeRequest    *request,
 
   if (!found_in_cache)
     {
+      GtkRequisition requisition;
       gint min_size = 0, nat_size = 0;
       gint group_size, requisition_size;
 
       /* Unconditional size request runs but is often unhandled. */
       do_size_request (widget);
 
+      gtk_widget_get_requisition (widget, &requisition);
       if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
         {
-          requisition_size = widget->requisition.width;
+          requisition_size = requisition.width;
 
           if (for_size < 0)
             GTK_SIZE_REQUEST_GET_IFACE (request)->get_width (request, &min_size, &nat_size);
@@ -280,7 +286,7 @@ compute_size_for_orientation (GtkSizeRequest    *request,
         }
       else
         {
-          requisition_size = widget->requisition.height;
+          requisition_size = requisition.height;
 
           if (for_size < 0)
             GTK_SIZE_REQUEST_GET_IFACE (request)->get_height (request, &min_size, &nat_size);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]