]> Pileus Git - ~andy/gtk/commitdiff
Be more careful when handling (GtkIconSize)-1. (#456137, Harry Lu, Chris
authorMatthias Clasen <mclasen@redhat.com>
Tue, 16 Oct 2007 20:08:31 +0000 (20:08 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 16 Oct 2007 20:08:31 +0000 (20:08 +0000)
2007-10-16  Matthias Clasen <mclasen@redhat.com>

        * gkt/gtkiconsize.c: Be more careful when handling
        (GtkIconSize)-1.  (#456137, Harry Lu, Chris Wang, et al)

svn path=/trunk/; revision=18916

ChangeLog
gtk/gtkiconfactory.c

index d7894cdeff667fc50cf5e8fc6cdf32f7abef10bc..a325daef73ea7915f777149e1d72d93261036f7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-16  Matthias Clasen <mclasen@redhat.com>
+
+       * gkt/gtkiconsize.c: Be more careful when handling 
+       (GtkIconSize)-1.  (#456137, Harry Lu, Chris Wang, et al)
+
 2007-10-16  Matthias Clasen <mclasen@redhat.com>
 
        * gtk/gtktextiter.c (gtk_text_iter_forward_line): Improve 
index d581d605b2e8144d26afa885d63830172e7e3bb2..b10e0e685b6ce3a31c7a0ce6c7d59aba2fb1622d 100644 (file)
@@ -831,6 +831,9 @@ icon_size_lookup_intern (GtkSettings *settings,
   
   init_icon_sizes ();
 
+  if (size == (GtkIconSize)-1)
+    return FALSE:
+
   if (size >= icon_sizes_used)
     return FALSE;
 
@@ -1338,7 +1341,7 @@ find_best_matching_source (GtkIconSet       *icon_set,
       
       if ((s->any_direction || (s->direction == direction)) &&
           (s->any_state || (s->state == state)) &&
-          (s->any_size || (sizes_equivalent (size, s->size))))
+          (s->any_size || size == (GtkIconSize)-1 || (sizes_equivalent (size, s->size))))
         {
          if (!g_slist_find (failed, s))
            {
@@ -1417,7 +1420,7 @@ render_icon_name_pixbuf (GtkIconSource    *icon_source,
 
   if (!gtk_icon_size_lookup_for_settings (settings, size, &width, &height))
     {
-      if (size == -1)
+      if (size == (GtkIconSize)-1)
        {
          /* Find an available size close to 48 
           */
@@ -2438,7 +2441,7 @@ find_in_cache (GtkIconSet      *icon_set,
       if (icon->style == style &&
           icon->direction == direction &&
           icon->state == state &&
-          icon->size == size)
+          (size == (GtkIconSize)-1 || icon->size == size))
         {
           if (prev)
             {