Index: gtk/gtkprogressbar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogressbar.c,v
retrieving revision 1.41
diff -u -b -B -p -r1.41 gtkprogressbar.c
--- gtk/gtkprogressbar.c	18 Oct 2002 19:40:27 -0000	1.41
+++ gtk/gtkprogressbar.c	23 Oct 2002 21:51:50 -0000
@@ -518,18 +518,29 @@ gtk_progress_bar_act_mode_enter (GtkProg
   GtkProgressBar *pbar;
   GtkWidget *widget;
   gint size;
+  GtkProgressBarOrientation orientation;
+  GtkTextDirection direction;
 
   pbar = GTK_PROGRESS_BAR (progress);
   widget = GTK_WIDGET (progress);
 
+  orientation = pbar->orientation;
+  direction = gtk_widget_get_direction (widget);
+  if (direction == GTK_TEXT_DIR_RTL) {
+    if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
+      orientation = GTK_PROGRESS_RIGHT_TO_LEFT;
+    else if (pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+      orientation = GTK_PROGRESS_LEFT_TO_RIGHT;
+  }
+ 
   /* calculate start pos */
 
-  if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
-      pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+  if (orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
+      orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
     {
       size = MAX (2, widget->allocation.width / pbar->activity_blocks);
 
-      if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
+      if (orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
 	{
 	  pbar->activity_pos = widget->style->xthickness;
 	  pbar->activity_dir = 0;
@@ -546,7 +557,7 @@ gtk_progress_bar_act_mode_enter (GtkProg
     {
       size = MAX (2, widget->allocation.height / pbar->activity_blocks);
 
-      if (pbar->orientation == GTK_PROGRESS_TOP_TO_BOTTOM)
+      if (orientation == GTK_PROGRESS_TOP_TO_BOTTOM)
 	{
 	  pbar->activity_pos = widget->style->ythickness;
 	  pbar->activity_dir = 0;
@@ -574,14 +585,25 @@ gtk_progress_bar_paint (GtkProgress *pro
   gint y;
   gdouble percentage;
   gint size;
+  GtkProgressBarOrientation orientation;
+  GtkTextDirection direction;
 
   g_return_if_fail (GTK_IS_PROGRESS_BAR (progress));
 
   pbar = GTK_PROGRESS_BAR (progress);
   widget = GTK_WIDGET (progress);
 
-  if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
-      pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+  orientation = pbar->orientation;
+  direction = gtk_widget_get_direction (widget);
+  if (direction == GTK_TEXT_DIR_RTL) {
+    if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT)
+      orientation = GTK_PROGRESS_RIGHT_TO_LEFT;
+    else if (pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+      orientation = GTK_PROGRESS_LEFT_TO_RIGHT;
+  }
+ 
+  if (orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
+      orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
     space = widget->allocation.width -
       2 * widget->style->xthickness;
   else
@@ -602,8 +624,8 @@ gtk_progress_bar_paint (GtkProgress *pro
       
       if (progress->activity_mode)
 	{
-	  if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
-	      pbar->orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
+	  if (orientation == GTK_PROGRESS_LEFT_TO_RIGHT ||
+	      orientation == GTK_PROGRESS_RIGHT_TO_LEFT)
 	    {
 	      size = MAX (2, widget->allocation.width / pbar->activity_blocks);
 	      
@@ -637,7 +659,7 @@ gtk_progress_bar_paint (GtkProgress *pro
       
       if (amount > 0)
 	{
-	  switch (pbar->orientation)
+	  switch (orientation)
 	    {
 	      
 	    case GTK_PROGRESS_LEFT_TO_RIGHT:
