--- svn/gtkcellrenderertext.c	2007-11-15 18:10:12.000000000 +0100
+++ gtkcellrenderertext.c	2007-11-16 15:36:46.000000000 +0100
@@ -19,6 +19,7 @@
 
 #include <config.h>
 #include <stdlib.h>
+#include <string.h>
 #include "gtkcellrenderertext.h"
 #include "gtkeditable.h"
 #include "gtkentry.h"
@@ -139,6 +140,7 @@
   PangoEllipsizeMode ellipsize;
   PangoWrapMode wrap_mode;
   PangoAlignment align;
+  PangoFontDescription *set_font;
   
   gulong populate_popup_id;
   gulong entry_menu_popdown_timeout;
@@ -170,6 +172,7 @@
   priv->wrap_width = -1;
   priv->align = PANGO_ALIGN_LEFT;
   priv->align_set = FALSE;
+  priv->set_font = pango_font_description_copy (celltext->font);
 }
 
 static void
@@ -594,6 +597,7 @@
   priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (object);
 
   pango_font_description_free (celltext->font);
+  pango_font_description_free (priv->set_font);
 
   g_free (celltext->text);
 
@@ -686,31 +690,31 @@
       break;
 
     case PROP_FAMILY:
-      g_value_set_string (value, pango_font_description_get_family (celltext->font));
+      g_value_set_string (value, pango_font_description_get_family (priv->set_font));
       break;
 
     case PROP_STYLE:
-      g_value_set_enum (value, pango_font_description_get_style (celltext->font));
+      g_value_set_enum (value, pango_font_description_get_style (priv->set_font));
       break;
 
     case PROP_VARIANT:
-      g_value_set_enum (value, pango_font_description_get_variant (celltext->font));
+      g_value_set_enum (value, pango_font_description_get_variant (priv->set_font));
       break;
 
     case PROP_WEIGHT:
-      g_value_set_int (value, pango_font_description_get_weight (celltext->font));
+      g_value_set_int (value, pango_font_description_get_weight (priv->set_font));
       break;
 
     case PROP_STRETCH:
-      g_value_set_enum (value, pango_font_description_get_stretch (celltext->font));
+      g_value_set_enum (value, pango_font_description_get_stretch (priv->set_font));
       break;
 
     case PROP_SIZE:
-      g_value_set_int (value, pango_font_description_get_size (celltext->font));
+      g_value_set_int (value, pango_font_description_get_size (priv->set_font));
       break;
 
     case PROP_SIZE_POINTS:
-      g_value_set_double (value, ((double)pango_font_description_get_size (celltext->font)) / (double)PANGO_SCALE);
+      g_value_set_double (value, ((double)pango_font_description_get_size (priv->set_font)) / (double)PANGO_SCALE);
       break;
 
     case PROP_SCALE:
@@ -874,38 +878,76 @@
 }
 
 static PangoFontMask
-set_font_desc_fields (PangoFontDescription *desc,
-		      PangoFontMask         to_set)
+set_font_desc_fields_from_desc (PangoFontDescription *desc,
+				PangoFontDescription *desc_src,
+				PangoFontMask         to_set)
 {
   PangoFontMask changed_mask = 0;
   
   if (to_set & PANGO_FONT_MASK_FAMILY)
     {
-      const char *family = pango_font_description_get_family (desc);
+      const char *family = pango_font_description_get_family (desc_src);
       if (!family)
 	{
 	  family = "sans";
 	  changed_mask |= PANGO_FONT_MASK_FAMILY;
 	}
+      else
+        {
+	  const char *family_old = pango_font_description_get_family (desc);
+	  if (!family_old || strcmp (family, family_old))
+	      changed_mask |= PANGO_FONT_MASK_FAMILY;
+	}
 
       pango_font_description_set_family (desc, family);
     }
   if (to_set & PANGO_FONT_MASK_STYLE)
-    pango_font_description_set_style (desc, pango_font_description_get_style (desc));
+    {
+      PangoStyle style = pango_font_description_get_style (desc_src);
+      if (style != pango_font_description_get_style (desc))
+        changed_mask |= PANGO_FONT_MASK_STYLE;
+
+      pango_font_description_set_style (desc, style);
+    }
   if (to_set & PANGO_FONT_MASK_VARIANT)
-    pango_font_description_set_variant (desc, pango_font_description_get_variant (desc));
+    {
+      PangoVariant variant = pango_font_description_get_variant (desc_src);
+      if (variant != pango_font_description_get_variant (desc))
+        changed_mask |= PANGO_FONT_MASK_VARIANT;
+
+      pango_font_description_set_variant (desc, variant);
+    }
   if (to_set & PANGO_FONT_MASK_WEIGHT)
-    pango_font_description_set_weight (desc, pango_font_description_get_weight (desc));
+    {
+      PangoWeight weight = pango_font_description_get_weight (desc_src);
+      if (weight != pango_font_description_get_weight (desc))
+        changed_mask |= PANGO_FONT_MASK_WEIGHT;
+
+      pango_font_description_set_weight (desc, weight);
+    }
   if (to_set & PANGO_FONT_MASK_STRETCH)
-    pango_font_description_set_stretch (desc, pango_font_description_get_stretch (desc));
+    {
+      PangoStretch stretch = pango_font_description_get_stretch (desc_src);
+      if (stretch != pango_font_description_get_stretch (desc))
+        changed_mask |= PANGO_FONT_MASK_STRETCH;
+
+      pango_font_description_set_stretch (desc, stretch);
+    }
   if (to_set & PANGO_FONT_MASK_SIZE)
     {
-      gint size = pango_font_description_get_size (desc);
+      gint size = pango_font_description_get_size (desc_src);
       if (size <= 0)
 	{
 	  size = 10 * PANGO_SCALE;
 	  changed_mask |= PANGO_FONT_MASK_SIZE;
 	}
+      else
+	{
+	  if (size != pango_font_description_get_size (desc))
+	    {
+	      changed_mask |= PANGO_FONT_MASK_SIZE;
+	    }
+	}
       
       pango_font_description_set_size (desc, size);
     }
@@ -956,7 +998,8 @@
   GObject *object = G_OBJECT (celltext);
   PangoFontDescription *new_font_desc;
   PangoFontMask old_mask, new_mask, changed_mask, set_changed_mask;
-  
+  GtkCellRendererTextPrivate *priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (object);
+
   if (font_desc)
     new_font_desc = pango_font_description_copy (font_desc);
   else
@@ -970,7 +1013,10 @@
 
   pango_font_description_free (celltext->font);
   celltext->font = new_font_desc;
-  
+
+  pango_font_description_free (priv->set_font);
+  priv->set_font = pango_font_description_copy (celltext->font);
+
   g_object_freeze_notify (object);
 
   g_object_notify (object, "font-desc");
@@ -1151,31 +1197,45 @@
 	  case PROP_FAMILY:
 	    pango_font_description_set_family (celltext->font,
 					       g_value_get_string (value));
+	    pango_font_description_set_family (priv->set_font,
+					       g_value_get_string (value));
 	    break;
 	  case PROP_STYLE:
 	    pango_font_description_set_style (celltext->font,
 					      g_value_get_enum (value));
+	    pango_font_description_set_style (priv->set_font,
+					      g_value_get_enum (value));
 	    break;
 	  case PROP_VARIANT:
 	    pango_font_description_set_variant (celltext->font,
 						g_value_get_enum (value));
+	    pango_font_description_set_variant (priv->set_font,
+						g_value_get_enum (value));
 	    break;
 	  case PROP_WEIGHT:
 	    pango_font_description_set_weight (celltext->font,
 					       g_value_get_int (value));
+	    pango_font_description_set_weight (priv->set_font,
+					       g_value_get_int (value));
 	    break;
 	  case PROP_STRETCH:
 	    pango_font_description_set_stretch (celltext->font,
 						g_value_get_enum (value));
+	    pango_font_description_set_stretch (priv->set_font,
+						g_value_get_enum (value));
 	    break;
 	  case PROP_SIZE:
 	    pango_font_description_set_size (celltext->font,
 					     g_value_get_int (value));
+	    pango_font_description_set_size (priv->set_font,
+					     g_value_get_int (value));
 	    g_object_notify (object, "size-points");
 	    break;
 	  case PROP_SIZE_POINTS:
 	    pango_font_description_set_size (celltext->font,
 					     g_value_get_double (value) * PANGO_SCALE);
+	    pango_font_description_set_size (priv->set_font,
+					     g_value_get_double (value) * PANGO_SCALE);
 	    g_object_notify (object, "size");
 	    break;
 	  }
@@ -1284,8 +1344,9 @@
 	{
 	  PangoFontMask changed_mask;
 	  
-	  changed_mask = set_font_desc_fields (celltext->font,
-					       get_property_font_set_mask (param_id));
+	  changed_mask = set_font_desc_fields_from_desc (celltext->font,
+	  						 priv->set_font,
+							 get_property_font_set_mask (param_id));
 	  notify_fields_changed (G_OBJECT (celltext), changed_mask);
 	}
       break;
