From 07ef355b517f42ffa06074d265711b3ae8690ed4 Mon Sep 17 00:00:00 2001 From: tiago Date: Tue, 10 Aug 2010 14:25:10 +0000 Subject: [PATCH] Adding checkers to data and font lists get git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@50964 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_edit.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 3a51678..156323b 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -1102,16 +1102,16 @@ EAPI Eina_List * edje_edit_group_data_list_get(Evas_Object * obj) { Eina_Iterator *it; - Eina_List *datas; + Eina_List *datas = NULL; const char *key; GET_ED_OR_RETURN(NULL); - if (!ed->file || !ed->collection) + if (!ed->file || !ed->collection || !ed->collection->data) return NULL; - datas = NULL; it = eina_hash_iterator_key_new(ed->collection->data); + if (!it) return NULL; EINA_ITERATOR_FOREACH(it, key) datas = eina_list_append(datas, eina_stringshare_add(key)); @@ -3875,20 +3875,22 @@ FUNC_TEXT_BOOL_FIT(y); EAPI Eina_List * edje_edit_fonts_list_get(Evas_Object *obj) { - Edje_Font_Directory_Entry *f; - Eina_Iterator *i; + Eina_Iterator *it; Eina_List *fonts = NULL; + Edje_Font_Directory_Entry *f; GET_ED_OR_RETURN(NULL); - if (!ed->file) return NULL; + if (!ed->file || !ed->file->fonts) return NULL; - //printf("GET FONT LIST for %s\n", ed->file->path); - i = eina_hash_iterator_data_new(ed->file->fonts); + it = eina_hash_iterator_data_new(ed->file->fonts); + if (!it) return NULL; - EINA_ITERATOR_FOREACH(i, f) + EINA_ITERATOR_FOREACH(it, f) fonts = eina_list_append(fonts, f); + eina_iterator_free(it); + return fonts; } -- 2.7.4