[evolution-patches] Patch for #74404



Dear hpj,

Here is the new patch for #74404.
the related URL is:
http://bugzilla.ximian.com/show_bug.cgi?id=74404.

It is about addressbook a11y part.

Will you please help me to review it?

Thanks a lot.

Yours,
Mengjie

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/a11y/ChangeLog,v
retrieving revision 1.34
diff -u -p -r1.34 ChangeLog
--- ChangeLog	25 Feb 2005 06:48:18 -0000	1.34
+++ ChangeLog	6 Apr 2005 09:23:30 -0000
@@ -1,3 +1,15 @@
+2005-04-06  Yu Mengjie  <meng-jie yu sun com>
+
+	* addressbook/ea-minicard-view.c: (ea_minicard_view_get_name),
+	(ea_minicard_view_ref_state_set):
+	return proper atk_object and atk_stateset to avoid crash.
+	
+	* addressbook/ea-minicard.c: (ea_minicard_get_name),
+	(ea_minicard_ref_state_set):
+	return proper atk_object and atk_stateset to avoid crash.
+
+	Fixes #74404
+
 2005-02-23  Li Yuan  <li yuan sun com>
 
 	Fix for 72897 and 72797.
Index: addressbook/ea-minicard-view.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/addressbook/ea-minicard-view.c,v
retrieving revision 1.5
diff -u -p -r1.5 ea-minicard-view.c
--- addressbook/ea-minicard-view.c	22 Feb 2005 03:24:41 -0000	1.5
+++ addressbook/ea-minicard-view.c	6 Apr 2005 09:23:31 -0000
@@ -146,6 +146,9 @@ ea_minicard_view_get_name (AtkObject *ac
 
 	reflow = E_REFLOW(atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)));
 
+	if (!reflow)
+		return NULL;
+
 	string = g_strdup_printf (ngettext ("current addressbook folder has %d card", 
 				   "current addressbook folder has %d cards", 
 				   reflow->count), reflow->count);
@@ -206,10 +209,11 @@ static AtkStateSet *ea_minicard_view_ref
 	
 	state_set = ATK_OBJECT_CLASS (parent_class)->ref_state_set (obj);
 	if( !state_set )
-		return NULL;
+		state_set = atk_state_set_new ();
+
 	gobj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (obj));
 	if( !gobj )
-		return NULL;
+		return state_set;
 	
 	atk_state_set_add_state (state_set, ATK_STATE_ENABLED);
 	atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
Index: addressbook/ea-minicard.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/addressbook/ea-minicard.c,v
retrieving revision 1.4
diff -u -p -r1.4 ea-minicard.c
--- addressbook/ea-minicard.c	22 Feb 2005 03:24:41 -0000	1.4
+++ addressbook/ea-minicard.c	6 Apr 2005 09:23:31 -0000
@@ -132,6 +132,9 @@ ea_minicard_get_name (AtkObject *accessi
 
 	card = E_MINICARD(atk_gobject_accessible_get_object 
 			 (ATK_GOBJECT_ACCESSIBLE(accessible)));
+	if (!card)
+		return NULL;
+
 	g_object_get (card->header_text, "text", &string, NULL);
 
 	if (e_contact_get (card->contact, E_CONTACT_IS_LIST))
@@ -189,10 +192,11 @@ static AtkStateSet *ea_minicard_ref_stat
 
 	state_set = ATK_OBJECT_CLASS (parent_class)->ref_state_set (obj);
 	if( !state_set )
-		return NULL;
+		state_set = atk_state_set_new ();
+
 	gobj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (obj));
 	if( !gobj )
-		return NULL;
+		return state_set;
 
 	atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
 	atk_state_set_add_state (state_set, ATK_STATE_ENABLED);


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