diff options
author | WooHyun Jung <wh0705.jung@samsung.com> | 2012-07-26 17:51:23 +0900 |
---|---|---|
committer | WooHyun Jung <wh0705.jung@samsung.com> | 2012-07-26 17:51:23 +0900 |
commit | 68657109ac08310647d102ead466b3137edf45be (patch) | |
tree | 51749c2ab2a23462b6516e32ab60a7b8440552ca | |
parent | 4f7bbc6b68a74eb3130222a087a3f031838d0701 (diff) | |
download | edje-68657109ac08310647d102ead466b3137edf45be.tar.gz edje-68657109ac08310647d102ead466b3137edf45be.tar.bz2 edje-68657109ac08310647d102ead466b3137edf45be.zip |
Edje text classes: Fixed issues with textblock and some inconsistency.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@73601 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
Conflicts:
ChangeLog
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/lib/edje_util.c | 35 |
2 files changed, 20 insertions, 20 deletions
@@ -421,3 +421,8 @@ * Textblock: Fixed issue with updating only the font size using text classes. + * Textblock: Fixed updating textblock text_class with + edje_text_class_set. + * Text classes: Fixed edje_text_class_set to behave like + edje_object_text_class_set (and as expected) wrt NULL fonts. + diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index 07678f4..42c83b2 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -732,23 +732,20 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz tc->font = eina_stringshare_add(font); tc->size = size; - return EINA_FALSE; } - - /* If the class found is the same just return */ - if ((tc->size == size) && (tc->font) && (!strcmp(tc->font, font))) - return EINA_TRUE; - - /* Update the class found */ - eina_stringshare_del(tc->font); - tc->font = eina_stringshare_add(font); - if (!tc->font) + else { - eina_hash_del(_edje_text_class_hash, text_class, tc); - free(tc); - return EINA_FALSE; + /* Match and the same, return */ + if ((tc->size == size) || + (tc->font == font) || + (tc->font && font && !strcmp(tc->font, font))) + return EINA_TRUE; + + /* Update the class found */ + eina_stringshare_del(tc->font); + tc->font = eina_stringshare_add(font); + tc->size = size; } - tc->size = size; /* Tell all members of the text class to recalc */ members = eina_hash_find(_edje_text_class_member_hash, text_class); @@ -839,12 +836,10 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char if ((tc->name) && (!strcmp(tc->name, text_class))) { /* Match and the same, return */ - if ((tc->font) && (font) && (!strcmp(tc->font, font)) && - (tc->size == size)) - return EINA_TRUE; - - /* No font but size is the same, return */ - if ((!tc->font) && (!font) && (tc->size == size)) return EINA_TRUE; + if ((tc->size == size) || + (tc->font == font) || + (tc->font && font && !strcmp(tc->font, font))) + return EINA_TRUE; /* Update new text class properties */ if (tc->font) eina_stringshare_del(tc->font); |