From c89ebc62afde7efbcb8f9e5f549837513fd2fafe Mon Sep 17 00:00:00 2001 From: WooHyun Jung Date: Mon, 4 Oct 2010 22:02:38 +0900 Subject: [PATCH] [colorpalette, colorpicker, editfield, dialoguegroup, slider] add NULL check in add_func --- src/lib/elm_colorpalette.c | 2 +- src/lib/elm_colorpicker.c | 3 ++- src/lib/elm_dialoguegroup.c | 8 ++++---- src/lib/elm_editfield.c | 2 +- src/lib/elm_slider.c | 13 +++++++------ 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/lib/elm_colorpalette.c b/src/lib/elm_colorpalette.c index e600a4f..35e0c98 100644 --- a/src/lib/elm_colorpalette.c +++ b/src/lib/elm_colorpalette.c @@ -370,9 +370,9 @@ EAPI Evas_Object *elm_colorpalette_add(Evas_Object *parent) Widget_Data *wd = NULL; Evas *e; - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); if (e == NULL) return NULL; + wd = ELM_NEW(Widget_Data); obj = elm_widget_add(e); elm_widget_type_set(obj, "colorpalette"); elm_widget_sub_object_add(parent, obj); diff --git a/src/lib/elm_colorpicker.c b/src/lib/elm_colorpicker.c index 027ad90..006a094 100644 --- a/src/lib/elm_colorpicker.c +++ b/src/lib/elm_colorpicker.c @@ -906,10 +906,11 @@ elm_colorpicker_add(Evas_Object * parent) Widget_Data *wd = NULL; Evas *e; - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); if (e == NULL) return NULL; + wd = ELM_NEW(Widget_Data); + e = evas_object_evas_get(parent); obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "colorpicker"); elm_widget_type_set(obj, "colorpicker"); diff --git a/src/lib/elm_dialoguegroup.c b/src/lib/elm_dialoguegroup.c index 91894ae..f4222f1 100644 --- a/src/lib/elm_dialoguegroup.c +++ b/src/lib/elm_dialoguegroup.c @@ -25,7 +25,6 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { Evas_Object *parent; - Evas *e; Evas_Object *box; Evas_Object *title_layout; const char *title; @@ -227,11 +226,12 @@ EAPI Evas_Object *elm_dialoguegroup_add(Evas_Object *parent) { Evas_Object *obj = NULL; Widget_Data *wd = NULL; + Evas *e = NULL; + e = evas_object_evas_get(parent); + if (e == NULL) return NULL; wd = ELM_NEW(Widget_Data); - wd->e = evas_object_evas_get(parent); - if (wd->e == NULL) return NULL; - obj = elm_widget_add(wd->e); + obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "dialoguegroup"); elm_widget_type_set(obj, "dialoguegroup"); elm_widget_sub_object_add(parent, obj); diff --git a/src/lib/elm_editfield.c b/src/lib/elm_editfield.c index 66c07a5..e701ea4 100644 --- a/src/lib/elm_editfield.c +++ b/src/lib/elm_editfield.c @@ -272,10 +272,10 @@ elm_editfield_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); if (e == NULL) return NULL; + wd = ELM_NEW(Widget_Data); obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "editfield"); elm_widget_type_set(obj, "editfield"); diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index 2d62fbb..22d764c 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -396,8 +396,9 @@ elm_slider_add(Evas_Object *parent) Evas *e; Widget_Data *wd; - wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); + if (e == NULL) return NULL; + wd = ELM_NEW(Widget_Data); obj = elm_widget_add(e); ELM_SET_WIDTYPE(widtype, "slider"); elm_widget_type_set(obj, "slider"); @@ -897,9 +898,9 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(d /** - * Set the right icon object of the slider object + * Set the end side icon object of the slider object * - * Once the right icon object is set, it will become a child of the slider object and + * Once the end side icon object is set, it will become a child of the slider object and * be deleted when the slider object is deleted. If another icon object is set * then the previous one becomes orophaned and will no longer be deleted along * with the slider. @@ -907,7 +908,7 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(d * @param obj The slider object * @param icon The icon object * - * @return 1 if icon set succeed, 0 if there is no part for right icon + * @return 1 if icon set succeed, 0 if there is no part for the end side icon * * @ingroup Slider */ @@ -936,10 +937,10 @@ elm_slider_end_icon_set(Evas_Object *obj, Evas_Object *icon) /** - * Get the right icon object of the slider object + * Get the end side icon object of the slider object * * @param obj The slider object - * @return The right icon object + * @return The end side icon object * * @ingroup Slider */ -- 2.7.4