[evolution-patches] gtkhtml, #59935, crash composing mail



Hi,
  I have just fixed bug #59935.  The bug can be reproduced as follows:

(1) composing a mail with HTML turned on.
(2) insert a link
(3) insert some spaces before the link
(4) move the caret to the link, then crash


I think the bug the reason is: when a space is inserted before the link, the function remove_empty_and_merge will be invoked and the link object will be destroyed. But engine->focus_object is still pointing to the destoryed
link object. Then crash...

I think since the focus has no use when it's in edit mode, we can just disable
html_engine_update_focus_if_necessary when in edit mode. The attachment is
a quite simple patch.

Regards,
Eric

Index: htmlengine.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine.c,v
retrieving revision 1.611
diff -u -p -r1.611 htmlengine.c
--- a/htmlengine.c	8 Jun 2004 11:47:54 -0000	1.611
+++ b/htmlengine.c	14 Jun 2004 10:24:09 -0000
@@ -6181,6 +6181,9 @@ set_frame_parents_focus_object (HTMLEngi
 void 
 html_engine_update_focus_if_necessary (HTMLEngine *e, HTMLObject *obj, gint offset)
 {
+	if (html_engine_get_editable(e))
+		return;
+
 	if (obj && (((HTML_IS_IMAGE (obj) && HTML_IMAGE (obj)->url && *HTML_IMAGE (obj)->url)) 
 		     || (HTML_IS_TEXT (obj) && html_object_get_complete_url (obj, offset))))
 		html_engine_set_focus_object (e, obj, offset);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]