[evolution-patches] [gtkhtml] Fix for bug #318973 Caret Mode broken



hi, gtkhtml maintainers

The attached is a patch for bug #318973 Caret Mode broken
I added code to handle situations when cursor->object->parent is NULL
(This is the initial status when caret mode is invoked)

Please review. 

Thanks 

--Irene

Index: src/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2159
diff -u -r1.2159 ChangeLog
--- src/ChangeLog	6 Feb 2006 09:59:36 -0000	1.2159
+++ src/ChangeLog	8 Feb 2006 11:54:21 -0000
@@ -1,3 +1,10 @@
+2006-02-08  Irene Huang <Irene Huang sun com>
+
+	Fixes bug #318973
+
+	* htmlcursor.c: (move_right): Add code to handle cursor movements when 
+	cursor->object->parent is NULL.
+
 2006-02-06  Veerapuram Varadhan <vvaradhan novell com>
 
 	** Fixes bug #326366
Index: src/htmlcursor.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlcursor.c,v
retrieving revision 1.74
diff -u -r1.74 htmlcursor.c
--- src/htmlcursor.c	31 Mar 2005 12:44:42 -0000	1.74
+++ src/htmlcursor.c	8 Feb 2006 11:54:21 -0000
@@ -1009,24 +1009,23 @@
 
 	retval = TRUE;
 	if (!html_object_cursor_right (cursor->object, e->painter, cursor)) {
-		if (cursor->object->parent) {
-			gboolean rv;
-			HTMLObject *orig = cursor->object;
+		gboolean rv;
+		HTMLObject *orig = cursor->object;
 
-			if (html_object_get_direction (cursor->object->parent) == HTML_DIRECTION_RTL)
-				rv = move_to_prev_object (cursor, e);
-			else
-				rv = move_to_next_object (cursor, e);
-
-			if (rv && !html_object_is_container (cursor->object) && cursor->object->parent == orig->parent) {
-				if (html_object_get_direction (cursor->object) == HTML_DIRECTION_RTL)
-					cursor->offset --;
-				else
-					cursor->offset ++;
-			}
+		if (cursor->object->parent && 
+			html_object_get_direction (cursor->object->parent) == HTML_DIRECTION_RTL)
+			rv = move_to_prev_object (cursor, e);
+		else
+			rv = move_to_next_object (cursor, e);
 
-			return rv;
+		if (rv && !html_object_is_container (cursor->object) && cursor->object->parent == orig->parent) {
+			if (html_object_get_direction (cursor->object) == HTML_DIRECTION_RTL)
+				cursor->offset --;
+			else
+				cursor->offset ++;
 		}
+
+		return rv;
 	}
 	return retval;
 }


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