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/addressbook/ea-minicard-view.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'a11y/addressbook/ea-minicard-view.c') 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); -- cgit v1.2.3