From 767efab6a063e1364bb542f725813e7db262aed0 Mon Sep 17 00:00:00 2001 From: hermet Date: Fri, 11 Mar 2011 09:43:48 +0000 Subject: [PATCH] elementary/els_scroller - added exception handling if user call any other APIs (ex, elm_smart_scroller_object_theme_object_set) before elm_smart_scroller_child_set? git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@57686 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/els_scroller.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lib/els_scroller.c b/src/lib/els_scroller.c index 4eaf479..d7328b6 100644 --- a/src/lib/els_scroller.c +++ b/src/lib/els_scroller.c @@ -2274,9 +2274,12 @@ _smart_scrollbar_reset(Smart_Data *sd) edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.vbar", 1.0, 1.0); edje_object_part_drag_size_set(sd->edje_obj, "elm.dragable.hbar", 1.0, 1.0); } - sd->pan_func.min_get(sd->pan_obj, &minx, &miny); - sd->pan_func.get(sd->pan_obj, &px, &py); - sd->pan_func.set(sd->pan_obj, minx, miny); + if (sd->pan_obj) + { + sd->pan_func.min_get(sd->pan_obj, &minx, &miny); + sd->pan_func.get(sd->pan_obj, &px, &py); + sd->pan_func.set(sd->pan_obj, minx, miny); + } if ((px != minx) || (py != miny)) edje_object_signal_emit(sd->edje_obj, "elm,action,scroll", "elm"); } @@ -2285,10 +2288,11 @@ static int _smart_scrollbar_bar_v_visibility_adjust(Smart_Data *sd) { int scroll_v_vis_change = 0; - Evas_Coord h, vw, vh; + Evas_Coord h, vw = 0, vh = 0; h = sd->child.h; - evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh); + if (sd->pan_obj) + evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh); if (sd->vbar_visible) { if (sd->vbar_flags == ELM_SMART_SCROLLER_POLICY_AUTO) @@ -2353,10 +2357,11 @@ static int _smart_scrollbar_bar_h_visibility_adjust(Smart_Data *sd) { int scroll_h_vis_change = 0; - Evas_Coord w, vw, vh; + Evas_Coord w, vw = 0, vh = 0; w = sd->child.w; - evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh); + if (sd->pan_obj) + evas_object_geometry_get(sd->pan_obj, NULL, NULL, &vw, &vh); if (sd->hbar_visible) { if (sd->hbar_flags == ELM_SMART_SCROLLER_POLICY_AUTO) -- 2.7.4