PsppireButtonBox: Remove dependence on flags deprecated in Gtk3
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 27 May 2013 10:27:53 +0000 (12:27 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 28 May 2013 14:04:24 +0000 (16:04 +0200)
src/ui/gui/psppire-hbuttonbox.c
src/ui/gui/psppire-vbuttonbox.c

index d200b9d0879fcec5d41932c8d972d4e56e83235c..c86d470725b598e7562a5de938b4510b2d9a107e 100644 (file)
@@ -37,7 +37,6 @@ static void gtk_hbutton_box_size_allocate (GtkWidget      *widget,
                                           GtkAllocation  *allocation);
 
 
-static const GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE;
 
 GType
 psppire_hbutton_box_get_type (void)
@@ -115,8 +114,7 @@ gtk_hbutton_box_size_request (GtkWidget      *widget,
   bbox = GTK_BUTTON_BOX (widget);
 
   spacing = gtk_box_get_spacing (box);
-  layout = gtk_button_box_get_layout (bbox) != GTK_BUTTONBOX_DEFAULT_STYLE
-         ? gtk_button_box_get_layout (bbox) : default_layout_style;
+  layout = gtk_button_box_get_layout (bbox) ;
 
   _psppire_button_box_child_requisition (widget,
                                      &nvis_children,
@@ -137,14 +135,12 @@ gtk_hbutton_box_size_request (GtkWidget      *widget,
       requisition->width =
              nvis_children*child_width + ((nvis_children+1)*spacing);
       break;
+    default:
     case GTK_BUTTONBOX_EDGE:
     case GTK_BUTTONBOX_START:
     case GTK_BUTTONBOX_END:
       requisition->width = nvis_children*child_width + ((nvis_children-1)*spacing);
       break;
-    default:
-      g_assert_not_reached();
-      break;
     }
 
     requisition->height = child_height;
@@ -180,8 +176,7 @@ gtk_hbutton_box_size_allocate (GtkWidget     *widget,
   base_box = GTK_BOX (widget);
   box = GTK_BUTTON_BOX (widget);
   spacing = gtk_box_get_spacing (base_box);
-  layout = gtk_button_box_get_layout (box) != GTK_BUTTONBOX_DEFAULT_STYLE
-         ? gtk_button_box_get_layout (box) : default_layout_style;
+  layout = gtk_button_box_get_layout (box) ;
   _psppire_button_box_child_requisition (widget,
                                      &nvis_children,
                                     &n_secondaries,
@@ -196,6 +191,7 @@ gtk_hbutton_box_size_allocate (GtkWidget     *widget,
     x = allocation->x + gtk_container_get_border_width (GTK_CONTAINER (box)) + childspacing;
     secondary_x = x + ((nvis_children - n_secondaries) * (child_width + childspacing));
     break;
+  default:
   case GTK_BUTTONBOX_EDGE:
     if (nvis_children >= 2)
       {
@@ -226,9 +222,6 @@ gtk_hbutton_box_size_allocate (GtkWidget     *widget,
       - gtk_container_get_border_width (GTK_CONTAINER (box));
     secondary_x = allocation->x + gtk_container_get_border_width (GTK_CONTAINER (box));
     break;
-  default:
-    g_assert_not_reached();
-    break;
   }
 
 
index 2af878f38e967c03819d8c6545be514b2a03f103..8c6d25afbe60ca4fe76fd2519c63723aa195bde2 100644 (file)
@@ -37,8 +37,6 @@ static void gtk_vbutton_box_size_allocate (GtkWidget      *widget,
                                           GtkAllocation  *allocation);
 
 
-static const GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE;
-
 GType
 psppire_vbutton_box_get_type (void)
 {
@@ -115,8 +113,7 @@ gtk_vbutton_box_size_request (GtkWidget      *widget,
   bbox = GTK_BUTTON_BOX (widget);
 
   spacing = gtk_box_get_spacing (box);
-  layout = gtk_button_box_get_layout (bbox) != GTK_BUTTONBOX_DEFAULT_STYLE
-         ? gtk_button_box_get_layout (bbox) : default_layout_style;
+  layout = gtk_button_box_get_layout (bbox);
 
   _psppire_button_box_child_requisition (widget,
                                         &nvis_children,
@@ -140,12 +137,10 @@ gtk_vbutton_box_size_request (GtkWidget      *widget,
       case GTK_BUTTONBOX_EDGE:
       case GTK_BUTTONBOX_START:
       case GTK_BUTTONBOX_END:
+      default:
         requisition->height =
                nvis_children*child_height + ((nvis_children-1)*spacing);
        break;
-      default:
-           g_assert_not_reached();
-           break;
       }
       requisition->width = child_width;
     }
@@ -180,8 +175,7 @@ gtk_vbutton_box_size_allocate (GtkWidget     *widget,
   base_box = GTK_BOX (widget);
   box = GTK_BUTTON_BOX (widget);
   spacing = gtk_box_get_spacing (base_box);
-  layout = gtk_button_box_get_layout (box) != GTK_BUTTONBOX_DEFAULT_STYLE
-         ? gtk_button_box_get_layout (box) : default_layout_style;
+  layout = gtk_button_box_get_layout (box) ;
   _psppire_button_box_child_requisition (widget,
                                      &nvis_children,
                                     &n_secondaries,
@@ -197,6 +191,7 @@ gtk_vbutton_box_size_allocate (GtkWidget     *widget,
     secondary_y = y + ((nvis_children - n_secondaries) * (child_height + childspacing));
     break;
   case GTK_BUTTONBOX_EDGE:
+  default:
     if (nvis_children >= 2)
       {
         childspacing = (height - (nvis_children*child_height)) / (nvis_children-1);
@@ -226,9 +221,6 @@ gtk_vbutton_box_size_allocate (GtkWidget     *widget,
       - gtk_container_get_border_width (GTK_CONTAINER (box));
     secondary_y = allocation->y + gtk_container_get_border_width (GTK_CONTAINER (box));
     break;
-  default:
-    g_assert_not_reached();
-    break;
   }
 
   x = allocation->x + (allocation->width - child_width) / 2;