summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-01-08 18:10:12 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-08 18:10:12 +0900
commitb115cc1a93a849dbe019b4310a361eb3d4a48291 (patch)
tree4bad99a3a465c12f9eadac1b30a9530be709720a
parent2955ebc5dd01fbfb5a3286b724c8a40915864ad8 (diff)
genlist: +parent validation check
-rw-r--r--src/lib/elm_genlist.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index b98007156..f9f0202ed 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -6066,12 +6066,19 @@ _list_last_recursive(Eina_List *list)
6066} 6066}
6067 6067
6068EOLIAN static Elm_Object_Item* 6068EOLIAN static Elm_Object_Item*
6069_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) 6069_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)
6070{ 6070{
6071 Elm_Gen_Item *it; 6071 Elm_Gen_Item *it;
6072 6072
6073 if (eo_parent)
6074 {
6075 ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
6076 ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
6077 EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
6078 }
6079
6073 it = _elm_genlist_item_new 6080 it = _elm_genlist_item_new
6074 (sd, itc, data, parent, type, func, func_data); 6081 (sd, itc, data, eo_parent, type, func, func_data);
6075 if (!it) return NULL; 6082 if (!it) return NULL;
6076 6083
6077 if (!it->parent) 6084 if (!it->parent)
@@ -6092,7 +6099,7 @@ _elm_genlist_item_append(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Ge
6092 if (!eo_it2) eo_it2 = EO_OBJ(it->parent); 6099 if (!eo_it2) eo_it2 = EO_OBJ(it->parent);
6093 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2); 6100 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2);
6094 sd->items = eina_inlist_append_relative 6101 sd->items = eina_inlist_append_relative
6095 (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2)); 6102 (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2));
6096 it->item->rel = it2; 6103 it->item->rel = it2;
6097 it2->item->rel_revs = eina_list_append(it2->item->rel_revs, it); 6104 it2->item->rel_revs = eina_list_append(it2->item->rel_revs, it);
6098 } 6105 }
@@ -6103,12 +6110,19 @@ _elm_genlist_item_append(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Ge
6103} 6110}
6104 6111
6105EOLIAN static Elm_Object_Item* 6112EOLIAN static Elm_Object_Item*
6106_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) 6113_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)
6107{ 6114{
6108 Elm_Gen_Item *it; 6115 Elm_Gen_Item *it;
6109 6116
6117 if (eo_parent)
6118 {
6119 ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
6120 ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
6121 EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
6122 }
6123
6110 it = _elm_genlist_item_new 6124 it = _elm_genlist_item_new
6111 (sd, itc, data, parent, type, func, func_data); 6125 (sd, itc, data, eo_parent, type, func, func_data);
6112 if (!it) return NULL; 6126 if (!it) return NULL;
6113 6127
6114 if (!it->parent) 6128 if (!it->parent)
@@ -6129,7 +6143,7 @@ _elm_genlist_item_prepend(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_G
6129 if (!eo_it2) eo_it2 = EO_OBJ(it->parent); 6143 if (!eo_it2) eo_it2 = EO_OBJ(it->parent);
6130 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2); 6144 ELM_GENLIST_ITEM_DATA_GET(eo_it2, it2);
6131 sd->items = eina_inlist_prepend_relative 6145 sd->items = eina_inlist_prepend_relative
6132 (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2)); 6146 (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2));
6133 it->item->rel = it2; 6147 it->item->rel = it2;
6134 it2->item->rel_revs = eina_list_append(it2->item->rel_revs, it); 6148 it2->item->rel_revs = eina_list_append(it2->item->rel_revs, it);
6135 } 6149 }