]> Pileus Git - ~andy/gtk/commitdiff
msw-engine: Remove sanitize_size code
authorBenjamin Otte <otte@redhat.com>
Mon, 20 Sep 2010 14:36:25 +0000 (16:36 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:43 +0000 (15:11 +0200)
It's not needed with the new APIs

modules/engines/ms-windows/msw_style.c

index a5dbcd204d37c91f94557a0e9b5889b46244319d..dacb6627b831f5ca7b16f15a719f805add491a0c 100755 (executable)
@@ -873,28 +873,6 @@ setup_system_styles (GtkStyle *style)
     }
 }
 
-static gboolean
-sanitize_size (GdkWindow *window, gint *width, gint *height)
-{
-  gboolean set_bg = FALSE;
-
-  if ((*width == -1) && (*height == -1))
-    {
-      set_bg = GDK_IS_WINDOW (window);
-      gdk_drawable_get_size (window, width, height);
-    }
-  else if (*width == -1)
-    {
-      gdk_drawable_get_size (window, width, NULL);
-    }
-  else if (*height == -1)
-    {
-      gdk_drawable_get_size (window, NULL, height);
-    }
-
-  return set_bg;
-}
-
 static XpThemeElement
 map_gtk_progress_bar_to_xp (GtkProgressBar *progress_bar, gboolean trough)
 {
@@ -1366,8 +1344,6 @@ draw_arrow (GtkStyle *style,
 
   name = gtk_widget_get_name (widget);
 
-  sanitize_size (window, &width, &height);
-
   if (GTK_IS_ARROW (widget) && is_combo_box_child (widget) && xp_theme_is_active ())
     return;
 
@@ -1452,8 +1428,6 @@ draw_arrow (GtkStyle *style,
 
          if (widget)
            {
-             sanitize_size (window, &width, &height);
-
              dc = get_window_dc (style, window, state, &dc_info,
                                  box_x, box_y, box_width, box_height, &rect);
              DrawFrameControl (dc, &rect, DFC_SCROLL,
@@ -2028,7 +2002,6 @@ draw_box (GtkStyle *style,
              RECT rect;
              XpDCInfo dc_info;
 
-             sanitize_size (window, &width, &height);
              dc = get_window_dc (style, window, state_type, &dc_info, x, y, width, height, &rect);
 
              SetTextColor (dc, GetSysColor (COLOR_3DHILIGHT));
@@ -2104,7 +2077,6 @@ draw_box (GtkStyle *style,
               || strcmp (detail, "toolbar") == 0
               || strcmp (detail, "menubar") == 0))
     {
-      sanitize_size (window, &width, &height);
       if (xp_theme_draw (window, XP_THEME_ELEMENT_REBAR,
                         style, x, y, width, height, state_type, area))
        {
@@ -2176,8 +2148,6 @@ draw_box (GtkStyle *style,
 
       option_menu_get_props (widget, &indicator_size, &indicator_spacing);
 
-      sanitize_size (window, &width, &height);
-
       if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
        {
          vline_x =
@@ -2932,8 +2902,6 @@ draw_shadow (GtkStyle *style,
          HGDIOBJ old_pen = NULL;
          GtkPositionType pos;
 
-         sanitize_size (window, &width, &height);
-
          if (is_handlebox)
            {
              pos = gtk_handle_box_get_handle_position (GTK_HANDLE_BOX (widget));
@@ -3221,8 +3189,6 @@ draw_handle (GtkStyle *style,
     {
       XpThemeElement hndl;
 
-      sanitize_size (window, &width, &height);
-
       if (GTK_IS_HANDLE_BOX (widget))
        {
          GtkPositionType pos;
@@ -3277,8 +3243,6 @@ draw_handle (GtkStyle *style,
       GdkColor *light, *dark, *shadow;
       GdkRectangle dest;
 
-      sanitize_size (window, &width, &height);
-
       gtk_paint_box (style, window, state_type, shadow_type, area,
                     widget, detail, x, y, width, height);