Index: pango/opentype/pango-ot-buffer.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/pango-ot-buffer.c,v
retrieving revision 1.4
diff -u -p -r1.4 pango-ot-buffer.c
--- pango/opentype/pango-ot-buffer.c	14 Sep 2004 13:45:41 -0000	1.4
+++ pango/opentype/pango-ot-buffer.c	15 Mar 2005 03:08:31 -0000
@@ -79,8 +79,7 @@ void
 pango_ot_buffer_set_rtl (PangoOTBuffer *buffer,
 			 gboolean       rtl)
 {
-  rtl = rtl != FALSE;
-  buffer->rtl = rtl;
+  buffer->rtl = rtl != FALSE;
 }
 
 /**
Index: pango/opentype/pango-ot-ruleset.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/pango-ot-ruleset.c,v
retrieving revision 1.10
diff -u -p -r1.10 pango-ot-ruleset.c
--- pango/opentype/pango-ot-ruleset.c	29 Feb 2004 15:44:50 -0000	1.10
+++ pango/opentype/pango-ot-ruleset.c	15 Mar 2005 03:08:31 -0000
@@ -144,40 +144,27 @@ pango_ot_ruleset_substitute  (PangoOTRul
   
   TTO_GSUB gsub = NULL;
   
-  gboolean need_gsub = FALSE;
-
   g_return_if_fail (PANGO_OT_IS_RULESET (ruleset));
 
   for (i = 0; i < ruleset->rules->len; i++)
     {
       PangoOTRule *rule = &g_array_index (ruleset->rules, PangoOTRule, i);
 
-      if (rule->table_type == PANGO_OT_TABLE_GSUB)
-	need_gsub = TRUE;
-    }
-
-  if (need_gsub)
-    {
-
-      gsub = pango_ot_info_get_gsub (ruleset->info);
-
-      if (gsub)
-	TT_GSUB_Clear_Features (gsub);
-    }
-
-  for (i = 0; i < ruleset->rules->len; i++)
-    {
-      PangoOTRule *rule = &g_array_index (ruleset->rules, PangoOTRule, i);
+      if (rule->table_type != PANGO_OT_TABLE_GSUB)
+	continue;
 
-      if (rule->table_type == PANGO_OT_TABLE_GSUB)
+      if (!gsub)
 	{
+	  gsub = pango_ot_info_get_gsub (ruleset->info);
+
 	  if (gsub)
-	    TT_GSUB_Add_Feature (gsub, rule->feature_index, rule->property_bit);
+	    TT_GSUB_Clear_Features (gsub);
+	  else
+	    return;
 	}
-    }
 
-  if (!gsub)
-    return;
+      TT_GSUB_Add_Feature (gsub, rule->feature_index, rule->property_bit);
+    }
 
   TT_GSUB_Apply_String (gsub, buffer->buffer);
 }
@@ -190,43 +177,31 @@ pango_ot_ruleset_position (PangoOTRulese
   
   TTO_GPOS gpos = NULL;
   
-  gboolean need_gpos = FALSE;
-
   g_return_if_fail (PANGO_OT_IS_RULESET (ruleset));
 
   for (i = 0; i < ruleset->rules->len; i++)
     {
       PangoOTRule *rule = &g_array_index (ruleset->rules, PangoOTRule, i);
 
-      if (rule->table_type == PANGO_OT_TABLE_GPOS)
-	need_gpos = TRUE;
-    }
-
-  if (need_gpos)
-    gpos = pango_ot_info_get_gpos (ruleset->info);
+      if (rule->table_type != PANGO_OT_TABLE_GPOS)
+	continue;
 
-  if (gpos)
-    {
-      TT_GPOS_Clear_Features (gpos);
-
-      for (i = 0; i < ruleset->rules->len; i++)
-	{
-	  PangoOTRule *rule = &g_array_index (ruleset->rules, PangoOTRule, i);
-	  
-	  if (rule->table_type == PANGO_OT_TABLE_GPOS)
-	    TT_GPOS_Add_Feature (gpos, rule->feature_index, rule->property_bit);
-	}
-    }
-
-  /* Apply GPOS rules */
-  if (gpos)
-    {
-      if (TT_GPOS_Apply_String (ruleset->info->face, gpos, 0, buffer->buffer,
-				FALSE /* enable device-dependant values */,
-				buffer->rtl) == FT_Err_Ok)
-	{
-	  buffer->applied_gpos = TRUE;
-	}
-    }
+      if (!gpos)
+        {
+	  gpos = pango_ot_info_get_gpos (ruleset->info);
+
+	  if (gpos)
+	    TT_GPOS_Clear_Features (gpos);
+	  else
+	    return;
+        }
+
+      TT_GPOS_Add_Feature (gpos, rule->feature_index, rule->property_bit);
+    }
+
+  if (TT_GPOS_Apply_String (ruleset->info->face, gpos, 0, buffer->buffer,
+			    FALSE /* enable device-dependant values */,
+			    buffer->rtl) == FT_Err_Ok)
+    buffer->applied_gpos = TRUE;
 }
 
