Index: widgets/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/widgets/ChangeLog,v
retrieving revision 1.175
diff -u -p -r1.175 ChangeLog
--- widgets/ChangeLog	21 Jul 2006 05:47:36 -0000	1.175
+++ widgets/ChangeLog	28 Jul 2006 07:27:58 -0000
@@ -1,3 +1,10 @@
+2006-07-28  Hiroyuki Ikezoe  <poincare@ikezoe.net>
+
+	** Fixes bug 348638
+	* text/e-text.c: (insert_preedit_text): Preedit string of 0 length
+	handles as usual. gtk_im_context_get_preedit_string () returns 0
+	length string even if im-module has no preedit string.
+
 2006-07-21  Hiroyuki Ikezoe  <poincare@ikezoe.net>
 
 	** Fixes 342313.
Index: widgets/text/e-text.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/text/e-text.c,v
retrieving revision 1.173
diff -u -p -r1.173 e-text.c
--- widgets/text/e-text.c	21 Jul 2006 05:47:37 -0000	1.173
+++ widgets/text/e-text.c	28 Jul 2006 07:27:59 -0000
@@ -294,41 +294,38 @@ insert_preedit_text (EText *text)
 
 	g_string_prepend_len (tmp_string, text->text,length); 
 
-	if (text->preedit_len)
-		gtk_im_context_get_preedit_string (text->im_context,
+	gtk_im_context_get_preedit_string (text->im_context,
 					   &preedit_string, &preedit_attrs,
 					   NULL);
 
-	if (preedit_string && g_utf8_validate (preedit_string, -1, NULL))
+	if (g_utf8_validate (preedit_string, -1, NULL))
 		text->preedit_len = preedit_length = strlen (preedit_string);
 	else
 		text->preedit_len  = preedit_length = 0;
 
 	cpos = g_utf8_offset_to_pointer (text->text, text->selection_start) - text->text;	
 
-	if (preedit_length) {
-		g_string_insert (tmp_string, cpos, preedit_string);
+	g_string_insert (tmp_string, cpos, preedit_string);
 
-		reset_layout_attrs (text);
+	reset_layout_attrs (text);
 
-		attrs = pango_layout_get_attributes (text->layout);
-		if (!attrs) {
-			attrs = pango_attr_list_new ();
-			new_attrs = TRUE;
-		}
+	attrs = pango_layout_get_attributes (text->layout);
+	if (!attrs) {
+		attrs = pango_attr_list_new ();
+		new_attrs = TRUE;
+	}
 
-		pango_layout_set_text (text->layout, tmp_string->str, tmp_string->len);
+	pango_layout_set_text (text->layout, tmp_string->str, tmp_string->len);
 
-		pango_attr_list_splice (attrs, preedit_attrs, cpos, preedit_length);
+	pango_attr_list_splice (attrs, preedit_attrs, cpos, preedit_length);
 
-		if (new_attrs) {
-			pango_layout_set_attributes (text->layout, attrs);
-			pango_attr_list_unref (attrs);
-		}
+	if (new_attrs) {
+		pango_layout_set_attributes (text->layout, attrs);
+		pango_attr_list_unref (attrs);
 	}
 
-	if (preedit_string)
-		g_free (preedit_string);
+	g_free (preedit_string);
+
 	if (preedit_attrs)
 		pango_attr_list_unref (preedit_attrs);
 	if (tmp_string)
