From c6bef0e314761fa7cd51619b0987bb6d2d8095a6 Mon Sep 17 00:00:00 2001 From: Yu Mengjie Date: Thu, 7 Apr 2005 07:42:28 +0000 Subject: return proper atk_object name and atk_stateset to avoid crash. 2005-04-06 Yu Mengjie * addressbook/ea-minicard-view.c: (ea_minicard_view_get_name), (ea_minicard_view_ref_state_set): return proper atk_object name and atk_stateset to avoid crash. * addressbook/ea-minicard.c: (ea_minicard_get_name), (ea_minicard_ref_state_set): return proper atk_object name and atk_stateset to avoid crash. Fixes #74404 svn path=/trunk/; revision=29177 --- a11y/ChangeLog | 12 ++++++++++++ a11y/addressbook/ea-minicard-view.c | 8 ++++++-- a11y/addressbook/ea-minicard.c | 8 ++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) (limited to 'a11y') diff --git a/a11y/ChangeLog b/a11y/ChangeLog index e9c173661d..44113cf288 100644 --- a/a11y/ChangeLog +++ b/a11y/ChangeLog @@ -1,3 +1,15 @@ +2005-04-06 Yu Mengjie + + * addressbook/ea-minicard-view.c: (ea_minicard_view_get_name), + (ea_minicard_view_ref_state_set): + return proper atk_object name and atk_stateset to avoid crash. + + * addressbook/ea-minicard.c: (ea_minicard_get_name), + (ea_minicard_ref_state_set): + return proper atk_object name and atk_stateset to avoid crash. + + Fixes #74404 + 2005-02-23 Li Yuan Fix for 72897 and 72797. diff --git a/a11y/addressbook/ea-minicard-view.c b/a11y/addressbook/ea-minicard-view.c index 1170448576..b66dd6585e 100644 --- a/a11y/addressbook/ea-minicard-view.c +++ b/a11y/addressbook/ea-minicard-view.c @@ -146,6 +146,9 @@ ea_minicard_view_get_name (AtkObject *accessible) 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 (AtkObject *obj) 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); diff --git a/a11y/addressbook/ea-minicard.c b/a11y/addressbook/ea-minicard.c index ec8b7f2056..2bde576ab3 100644 --- a/a11y/addressbook/ea-minicard.c +++ b/a11y/addressbook/ea-minicard.c @@ -132,6 +132,9 @@ ea_minicard_get_name (AtkObject *accessible) 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_state_set (AtkObject *obj) 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); -- cgit