diff options
author | Mike Gorse <mgorse@suse.com> | 2012-08-23 03:16:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-08-23 04:49:54 +0800 |
commit | d629f894c41fdc9c3338c282332bc3d0151ed4e6 (patch) | |
tree | 901f4140317220bf799c75fa64ffaa19ca65ce17 /widgets | |
parent | 0ee1a173d52a671b2c3c0656fda74e6015cfd225 (diff) | |
download | gsoc2013-evolution-d629f894c41fdc9c3338c282332bc3d0151ed4e6.tar gsoc2013-evolution-d629f894c41fdc9c3338c282332bc3d0151ed4e6.tar.gz gsoc2013-evolution-d629f894c41fdc9c3338c282332bc3d0151ed4e6.tar.bz2 gsoc2013-evolution-d629f894c41fdc9c3338c282332bc3d0151ed4e6.tar.lz gsoc2013-evolution-d629f894c41fdc9c3338c282332bc3d0151ed4e6.tar.xz gsoc2013-evolution-d629f894c41fdc9c3338c282332bc3d0151ed4e6.tar.zst gsoc2013-evolution-d629f894c41fdc9c3338c282332bc3d0151ed4e6.zip |
Bug 682494 - Add some defensive checks in gal-a11y-e-text.c
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/text/gal-a11y-e-text.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index 5632665bc3..6f62ae74c6 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -93,11 +93,16 @@ et_get_extents (AtkComponent *component, static const gchar * et_get_full_text (AtkText *text) { - EText *etext = E_TEXT (atk_gobject_accessible_get_object ( - ATK_GOBJECT_ACCESSIBLE (text))); + GObject *obj; + EText *etext; ETextModel *model; const gchar *full_text; + obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); + if (obj == NULL) + return ""; + + etext = E_TEXT (obj); g_object_get (etext, "model", &model, NULL); full_text = e_text_model_get_text (model); @@ -109,10 +114,15 @@ static void et_set_full_text (AtkEditableText *text, const gchar *full_text) { - EText *etext = E_TEXT (atk_gobject_accessible_get_object ( - ATK_GOBJECT_ACCESSIBLE (text))); + GObject *obj; + EText *etext; ETextModel *model; + obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); + if (obj == NULL) + return; + + etext = E_TEXT (obj); g_object_get (etext, "model", &model, NULL); e_text_model_set_text (model, full_text); @@ -648,8 +658,13 @@ et_get_offset_at_point (AtkText *text, static gint et_get_n_selections (AtkText *text) { - EText *etext = E_TEXT (atk_gobject_accessible_get_object ( - ATK_GOBJECT_ACCESSIBLE (text))); + EText *etext; + GObject *obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); + + if (obj == NULL) + return -1; + etext = E_TEXT (obj); + if (etext->selection_start != etext->selection_end) return 1; |