Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2170.2.11
diff -u -r1.2170.2.11 ChangeLog
--- ChangeLog	12 Jun 2006 12:16:50 -0000	1.2170.2.11
+++ ChangeLog	15 Jun 2006 12:01:57 -0000
@@ -1,3 +1,9 @@
+2006-06-15  Nancy  <nancy.cai@sun.com>
+
+	Fixes bug # 342659 
+	* htmltext.c: (html_text_prepare_attrs): Correct display direction
+	for arabic.
+
 2006-06-12  Rohini S  <srohini@novell.com>
 
 	Fixes bug #303634
Index: htmltext.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltext.c,v
retrieving revision 1.288.2.1
diff -u -r1.288.2.1 htmltext.c
--- htmltext.c	8 Jun 2006 18:42:03 -0000	1.288.2.1
+++ htmltext.c	15 Jun 2006 12:01:58 -0000
@@ -1190,8 +1190,13 @@
 	HTMLClueFlow *flow = NULL;
 	HTMLEngine *e = NULL;
 	PangoAttribute *attr;
+	PangoDirection dir,org_dir;
 
 	attrs = pango_attr_list_new ();
+	org_dir = pango_context_get_base_dir(painter->pango_context);
+	dir = html_text_get_pango_direction(text);
+	if (org_dir != dir) 
+		pango_context_set_base_dir(painter->pango_context,dir);
 
 	if (HTML_OBJECT (text)->parent && HTML_IS_CLUEFLOW (HTML_OBJECT (text)->parent))
 		flow = HTML_CLUEFLOW (HTML_OBJECT (text)->parent);
@@ -1199,8 +1204,15 @@
 	if (painter->widget && GTK_IS_HTML (painter->widget))
 		e = html_object_engine (HTML_OBJECT (text), GTK_HTML (painter->widget)->engine);
 
-	if (flow && e)
+	if (flow && e) {
 		html_text_add_cite_color (attrs, text, flow, e);
+		if (org_dir != dir) {
+			html_engine_freeze (e);
+                	flow->dir = html_text_direction_pango_to_html(dir);
+                	html_engine_thaw(e);
+		}
+        }
+
 
 	if (HTML_IS_PLAIN_PAINTER (painter)) {
 		attr = pango_attr_family_new (painter->font_manager.fixed.face);
