Revert "Edje text classes: Fixed issues with textblock and some inconsistency."
authorWooHyun Jung <wh0705.jung@samsung.com>
Thu, 26 Jul 2012 08:18:02 +0000 (17:18 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Thu, 26 Jul 2012 08:18:02 +0000 (17:18 +0900)
This reverts commit 1767815bee458fcd02d7ccf7700e810cea2eeb57.

ChangeLog
src/lib/edje_util.c

index 1e92953..9fe922f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * 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.
-
index 8640727..10354db 100644 (file)
@@ -813,20 +813,23 @@ 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;
      }
-   else
-     {
-        /* 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;
+   /* 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)
+     {
+        eina_hash_del(_edje_text_class_hash, text_class, tc);
+       free(tc);
+       return EINA_FALSE;
      }
+   tc->size = size;
 
    /* Tell all members of the text class to recalc */
    members = eina_hash_find(_edje_text_class_member_hash, text_class);
@@ -917,10 +920,12 @@ 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->size == size) ||
-                  (tc->font == font) ||
-                  (tc->font && font && !strcmp(tc->font, font)))
-                return EINA_TRUE;
+            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;
 
             /* Update new text class properties */
             if (tc->font) eina_stringshare_del(tc->font);