genlist: +parent validation check

This commit is contained in:
ChunEon Park 2015-01-08 18:10:12 +09:00
parent 94f530fca9
commit 6f293dcf5f
1 changed files with 20 additions and 6 deletions

View File

@ -6066,12 +6066,19 @@ _list_last_recursive(Eina_List *list)
}
EOLIAN static Elm_Object_Item*
_elm_genlist_item_append(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data)
_elm_genlist_item_append(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *eo_parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data)
{
Elm_Gen_Item *it;
if (eo_parent)
{
ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
}
it = _elm_genlist_item_new
(sd, itc, data, parent, type, func, func_data);
(sd, itc, data, eo_parent, type, func, func_data);
if (!it) return NULL;
if (!it->parent)
@ -6103,12 +6110,19 @@ _elm_genlist_item_append(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Ge
}
EOLIAN static Elm_Object_Item*
_elm_genlist_item_prepend(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data)
_elm_genlist_item_prepend(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *eo_parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data)
{
Elm_Gen_Item *it;
if (eo_parent)
{
ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
}
it = _elm_genlist_item_new
(sd, itc, data, parent, type, func, func_data);
(sd, itc, data, eo_parent, type, func, func_data);
if (!it) return NULL;
if (!it->parent)