summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2015-01-07 18:11:51 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-01-07 18:12:33 +0900
commitd0bbe5f6cf6c43d2dca55fdc9a61fecfca091853 (patch)
tree92c8b66a2fa965c0e8eef7a087297b7fb0efdb64
parente08f609721f695fb26dcd59e1c72277cf081c0ad (diff)
genlist: add more arguments validation checks
-rw-r--r--src/lib/elm_genlist.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index c17362674..36333a63d 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -6136,19 +6136,26 @@ _elm_genlist_item_prepend(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_G
6136} 6136}
6137 6137
6138EOLIAN static Elm_Object_Item* 6138EOLIAN static Elm_Object_Item*
6139_elm_genlist_item_insert_after(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *eo_after, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data) 6139_elm_genlist_item_insert_after(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *eo_parent, Elm_Object_Item *eo_after, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data)
6140{ 6140{
6141 ELM_GENLIST_ITEM_DATA_GET(eo_after, after); 6141 ELM_GENLIST_ITEM_DATA_GET(eo_after, after);
6142 Elm_Gen_Item *it; 6142 Elm_Gen_Item *it;
6143 6143
6144 ELM_GENLIST_ITEM_CHECK_OR_RETURN(after, NULL); 6144 ELM_GENLIST_ITEM_CHECK_OR_RETURN(after, NULL);
6145 EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(after)), NULL);
6146 if (eo_parent)
6147 {
6148 ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
6149 ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
6150 EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
6151 }
6145 6152
6146 /* It makes no sense to insert after in an empty list with after != 6153 /* It makes no sense to insert after in an empty list with after !=
6147 * NULL, something really bad is happening in your app. */ 6154 * NULL, something really bad is happening in your app. */
6148 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL); 6155 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL);
6149 6156
6150 it = _elm_genlist_item_new 6157 it = _elm_genlist_item_new
6151 (sd, itc, data, parent, type, func, func_data); 6158 (sd, itc, data, eo_parent, type, func, func_data);
6152 if (!it) return NULL; 6159 if (!it) return NULL;
6153 6160
6154 if (!it->parent) 6161 if (!it->parent)
@@ -6174,19 +6181,26 @@ _elm_genlist_item_insert_after(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const
6174} 6181}
6175 6182
6176EOLIAN static Elm_Object_Item* 6183EOLIAN static Elm_Object_Item*
6177_elm_genlist_item_insert_before(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *eo_before, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data) 6184_elm_genlist_item_insert_before(Eo *obj, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *eo_parent, Elm_Object_Item *eo_before, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data)
6178{ 6185{
6179 ELM_GENLIST_ITEM_DATA_GET(eo_before, before); 6186 ELM_GENLIST_ITEM_DATA_GET(eo_before, before);
6180 Elm_Gen_Item *it; 6187 Elm_Gen_Item *it;
6181 6188
6182 ELM_GENLIST_ITEM_CHECK_OR_RETURN(before, NULL); 6189 ELM_GENLIST_ITEM_CHECK_OR_RETURN(before, NULL);
6190 EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(before)), NULL);
6191 if (eo_parent)
6192 {
6193 ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
6194 ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
6195 EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
6196 }
6183 6197
6184 /* It makes no sense to insert before in an empty list with before 6198 /* It makes no sense to insert before in an empty list with before
6185 * != NULL, something really bad is happening in your app. */ 6199 * != NULL, something really bad is happening in your app. */
6186 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL); 6200 EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL);
6187 6201
6188 it = _elm_genlist_item_new 6202 it = _elm_genlist_item_new
6189 (sd, itc, data, parent, type, func, func_data); 6203 (sd, itc, data, eo_parent, type, func, func_data);
6190 if (!it) return NULL; 6204 if (!it) return NULL;
6191 6205
6192 if (!it->parent) 6206 if (!it->parent)
@@ -6211,19 +6225,20 @@ _elm_genlist_item_insert_before(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, const
6211} 6225}
6212 6226
6213EOLIAN static Elm_Object_Item* 6227EOLIAN static Elm_Object_Item*
6214_elm_genlist_item_sorted_insert(Eo *obj, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data) 6228_elm_genlist_item_sorted_insert(Eo *obj, Elm_Genlist_Data *sd, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *eo_parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data)
6215{ 6229{
6216 Elm_Gen_Item *rel = NULL; 6230 Elm_Gen_Item *rel = NULL;
6217 Elm_Gen_Item *it; 6231 Elm_Gen_Item *it;
6218 6232
6219 if (parent) 6233 if (eo_parent)
6220 { 6234 {
6221 ELM_GENLIST_ITEM_CHECK_OR_RETURN(((Elm_Gen_Item *)parent), NULL); 6235 ELM_GENLIST_ITEM_DATA_GET(eo_parent, parent);
6222 EINA_SAFETY_ON_FALSE_RETURN_VAL(obj == WIDGET(((Elm_Gen_Item *)parent)), NULL); 6236 ELM_GENLIST_ITEM_CHECK_OR_RETURN(parent, NULL);
6237 EINA_SAFETY_ON_FALSE_RETURN_VAL((obj == WIDGET(parent)), NULL);
6223 } 6238 }
6224 6239
6225 it = _elm_genlist_item_new 6240 it = _elm_genlist_item_new
6226 (sd, itc, data, parent, type, func, func_data); 6241 (sd, itc, data, eo_parent, type, func, func_data);
6227 if (!it) return NULL; 6242 if (!it) return NULL;
6228 Elm_Object_Item *eo_it = EO_OBJ(it); 6243 Elm_Object_Item *eo_it = EO_OBJ(it);
6229 6244