tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c9232109f04efa5b38853950dc9c7cc67882b211
commit c9232109f04efa5b38853950dc9c7cc67882b211 Author: Tom Hacohen <t...@stosb.com> Date: Fri Apr 17 09:26:48 2015 +0100 Revert "edje: refactor styles_del() logic like styles_add()" We are in a feature freeze. No room for refactoring/new features, only surgical (or if you must, non-surgical) fixes! This reverts commit fa0384ed2c0f784d26f0bfbd4ff40940921768c4. --- src/lib/edje/edje_textblock_styles.c | 63 ++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c index b294731..c496ce2 100644 --- a/src/lib/edje/edje_textblock_styles.c +++ b/src/lib/edje/edje_textblock_styles.c @@ -291,7 +291,7 @@ _edje_textblock_style_member_add(Edje *ed, Edje_Style *stl) Edje_Style_Tag *tag; Eina_List *l; - if (!stl) return; + if (!stl) return ; EINA_LIST_FOREACH(stl->tags, l, tag) { @@ -300,21 +300,6 @@ _edje_textblock_style_member_add(Edje *ed, Edje_Style *stl) } } -static inline void -_edje_textblock_style_member_del(Edje *ed, Edje_Style *stl) -{ - Edje_Style_Tag *tag; - Eina_List *l; - - if (!stl) return; - - EINA_LIST_FOREACH(stl->tags, l, tag) - { - if (tag->text_class) - _edje_text_class_member_del(ed, tag->text_class); - } -} - void _edje_textblock_styles_add(Edje *ed, Edje_Real_Part *ep) { @@ -355,15 +340,53 @@ _edje_textblock_styles_del(Edje *ed, Edje_Part *pt) desc = (Edje_Part_Description_Text *)pt->default_desc; style = edje_string_get(&desc->text.style); - stl = _edje_textblock_style_search(ed, style); - _edje_textblock_style_member_del(ed, stl); + if (style) + { + Eina_List *l; + + EINA_LIST_FOREACH(ed->file->styles, l, stl) + { + if ((stl->name) && (!strcmp(stl->name, style))) break; + stl = NULL; + } + } + if (stl) + { + Edje_Style_Tag *tag; + Eina_List *l; + + EINA_LIST_FOREACH(stl->tags, l, tag) + { + if (tag->text_class) + _edje_text_class_member_del(ed, tag->text_class); + } + } for (i = 0; i < pt->other.desc_count; ++i) { desc = (Edje_Part_Description_Text *)pt->other.desc[i]; style = edje_string_get(&desc->text.style); - stl = _edje_textblock_style_search(ed, style); - _edje_textblock_style_member_del(ed, stl); + if (style) + { + Eina_List *l; + + EINA_LIST_FOREACH(ed->file->styles, l, stl) + { + if ((stl->name) && (!strcmp(stl->name, style))) break; + stl = NULL; + } + } + if (stl) + { + Edje_Style_Tag *tag; + Eina_List *l; + + EINA_LIST_FOREACH(stl->tags, l, tag) + { + if (tag->text_class) + _edje_text_class_member_del(ed, tag->text_class); + } + } } } --