[colorpalette, colorpicker, editfield, dialoguegroup, slider] add NULL check in add_func
authorWooHyun Jung <wh0705.jung@samsung.com>
Mon, 4 Oct 2010 13:02:38 +0000 (22:02 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 4 Oct 2010 13:02:38 +0000 (22:02 +0900)
src/lib/elm_colorpalette.c
src/lib/elm_colorpicker.c
src/lib/elm_dialoguegroup.c
src/lib/elm_editfield.c
src/lib/elm_slider.c

index e600a4f..35e0c98 100644 (file)
@@ -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);
index 027ad90..006a094 100644 (file)
@@ -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");
index 91894ae..f4222f1 100644 (file)
@@ -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);
index 66c07a5..e701ea4 100644 (file)
@@ -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");
index 2d62fbb..22d764c 100644 (file)
@@ -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
  */