From 783c45ac71e1c3ae516ee62222b0b27627b1ee3e Mon Sep 17 00:00:00 2001 From: hermet Date: Wed, 12 Oct 2011 05:23:26 +0000 Subject: [PATCH] elementary/panes - added exception handlings git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@64009 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_panes.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c index df9eb8c..f80fe85 100644 --- a/src/lib/elm_panes.c +++ b/src/lib/elm_panes.c @@ -102,9 +102,7 @@ static Eina_Bool _elm_panes_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next) { Widget_Data *wd = elm_widget_data_get(obj); - - if (!wd) - return EINA_FALSE; + if (!wd) return EINA_FALSE; double w, h; edje_object_part_drag_value_get(wd->panes, "elm.bar", &w, &h); @@ -265,6 +263,7 @@ elm_panes_content_left_set(Evas_Object *obj, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; if (wd->contents.left) { evas_object_del(wd->contents.left); @@ -283,6 +282,7 @@ elm_panes_content_right_set(Evas_Object *obj, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; if (wd->contents.right) { evas_object_del(wd->contents.right); @@ -301,6 +301,7 @@ elm_panes_content_left_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; return wd->contents.left; } @@ -347,6 +348,7 @@ elm_panes_content_left_size_get(const Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); double w, h; + if (!wd) return 0; edje_object_part_drag_value_get(wd->panes, "elm.bar", &w, &h); if (wd->horizontal) return h; else return w; @@ -357,7 +359,7 @@ elm_panes_content_left_size_set(Evas_Object *obj, double size) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - + if (!wd) return; if (size < 0.0) size = 0.0; else if (size > 1.0) size = 1.0; if (wd->horizontal) @@ -371,7 +373,7 @@ elm_panes_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); - + if (!wd) return; wd->horizontal = horizontal; _theme_hook(obj); elm_panes_content_left_size_set(obj, 0.5); @@ -382,6 +384,7 @@ elm_panes_horizontal_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; return wd->horizontal; } @@ -390,6 +393,7 @@ elm_panes_fixed_set(Evas_Object *obj, Eina_Bool fixed) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; wd->fixed = !!fixed; if (wd->fixed == EINA_TRUE) edje_object_signal_emit(wd->panes, "elm.panes.fixed", "elm"); @@ -402,5 +406,6 @@ elm_panes_fixed_get(const Evas_Object *obj) { ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; return wd->fixed; } -- 2.7.4