Index: gtkcellrenderertext.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcellrenderertext.c,v
retrieving revision 1.95
diff -u -p -r1.95 gtkcellrenderertext.c
--- gtkcellrenderertext.c	6 Jul 2006 05:14:01 -0000	1.95
+++ gtkcellrenderertext.c	17 Jul 2006 13:25:53 -0000
@@ -115,7 +115,8 @@ enum {
   PROP_UNDERLINE_SET,
   PROP_RISE_SET,
   PROP_LANGUAGE_SET,
-  PROP_ELLIPSIZE_SET
+  PROP_ELLIPSIZE_SET,
+  PROP_ALIGN_SET
 };
 
 static guint text_cell_renderer_signals [LAST_SIGNAL];
@@ -131,6 +132,7 @@ struct _GtkCellRendererTextPrivate
   guint language_set : 1;
   guint markup_set : 1;
   guint ellipsize_set : 1;
+  guint align_set : 1;
   
   gulong focus_out_id;
   PangoLanguage *language;
@@ -167,6 +169,7 @@ gtk_cell_renderer_text_init (GtkCellRend
   priv->width_chars = -1;
   priv->wrap_width = -1;
   priv->align = PANGO_ALIGN_LEFT;
+  priv->align_set = FALSE;
 }
 
 static void
@@ -549,6 +552,10 @@ gtk_cell_renderer_text_class_init (GtkCe
                 P_("Ellipsize set"),
                 P_("Whether this tag affects the ellipsize mode"));
 
+  ADD_SET_PROP ("align-set", PROP_ALIGN_SET,
+                P_("Align set"),
+                P_("Whether this tag affects the alignment mode"));
+
   text_cell_renderer_signals [EDITED] =
     g_signal_new (I_("edited"),
 		  G_OBJECT_CLASS_TYPE (object_class),
@@ -780,6 +787,10 @@ gtk_cell_renderer_text_get_property (GOb
     case PROP_ELLIPSIZE_SET:
       g_value_set_boolean (value, priv->ellipsize_set);
       break;
+
+    case PROP_ALIGN_SET:
+      g_value_set_boolean (value, priv->align_set);
+      break;
       
     case PROP_WIDTH_CHARS:
       g_value_set_int (value, priv->width_chars);
@@ -1234,6 +1245,8 @@ gtk_cell_renderer_text_set_property (GOb
 
     case PROP_ALIGN:
       priv->align = g_value_get_enum (value);
+      priv->align_set = TRUE;
+      g_object_notify (object, "align-set");
       break;
 
     case PROP_BACKGROUND_SET:
@@ -1292,6 +1305,10 @@ gtk_cell_renderer_text_set_property (GOb
     case PROP_ELLIPSIZE_SET:
       priv->ellipsize_set = g_value_get_boolean (value);
       break;
+
+    case PROP_ALIGN_SET:
+      priv->align_set = g_value_get_boolean (value);
+      break;
       
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -1433,7 +1450,19 @@ get_layout (GtkCellRendererText *celltex
       pango_layout_set_wrap (layout, PANGO_WRAP_CHAR);
     }
 
-  pango_layout_set_alignment (layout, priv->align);
+  if (priv->align_set)
+    pango_layout_set_alignment (layout, priv->align);
+  else
+    {
+      PangoAlignment align;
+
+      if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+	align = PANGO_ALIGN_RIGHT;
+      else
+	align = PANGO_ALIGN_LEFT;
+
+      pango_layout_set_alignment (layout, align);
+    }
 
   pango_layout_set_attributes (layout, attr_list);
 
