aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-04-17 09:26:48 +0100
committerTom Hacohen <tom@stosb.com>2015-04-17 09:26:48 +0100
commitc9232109f04efa5b38853950dc9c7cc67882b211 (patch)
treea094a8f8da6119d1952938dac9fba7a785b1543a
parentedje: refactor styles_del() logic like styles_add() (diff)
downloadefl-c9232109f04efa5b38853950dc9c7cc67882b211.tar.gz
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.
-rw-r--r--src/lib/edje/edje_textblock_styles.c63
1 files changed, 43 insertions, 20 deletions
diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c
index b294731845..c496ce2ba4 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);
+ }
+ }
}
}