rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=23c5ee1a81240c344a1fc0bfb347fd8aa01847d2

commit 23c5ee1a81240c344a1fc0bfb347fd8aa01847d2
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Wed Feb 3 15:17:09 2016 +0000

    property_style: set none if style of the text is not correct
    
    Since there are defined set of values defined for use, custom names are
    not allowed. But sometimes people does mistakes though.
    
    Fixes T3129
---
 src/bin/ui/property_style.c | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/src/bin/ui/property_style.c b/src/bin/ui/property_style.c
index cd880d7..fe157dc 100644
--- a/src/bin/ui/property_style.c
+++ b/src/bin/ui/property_style.c
@@ -391,8 +391,11 @@ _tag_parse(Style_Prop_Data *pd, const char *value, const 
char *text)
         else if (strstr(token, "shadow"))
           {
              style_table[DIRECTION_NUM][1] = 
eina_stringshare_add(strchr(token, ','));
-             style_length = (int)(strlen(token) - 
strlen(style_table[DIRECTION_NUM][1]));
-             style_table[exist][1] = eina_stringshare_add_length(token, 
style_length);
+             if (style_table[DIRECTION_NUM][1])
+               {
+                  style_length = (int)(strlen(token) - 
strlen(style_table[DIRECTION_NUM][1]));
+                  style_table[exist][1] = eina_stringshare_add_length(token, 
style_length);
+               }
           }
         else
           {
@@ -1096,6 +1099,24 @@ DIRECT_ADD(tl, "top_left", "tl", 5)
 DIRECT_ADD(t, "top", "t", 6)
 DIRECT_ADD(tr, "top_right", "tr", 7)
 
+static Eina_Bool
+_check_value(const char *list[], const char *value)
+{
+   Eina_Bool not_exist = true;
+   int i = 0;
+
+   for (i = 0; list[i] != NULL; i++)
+     {
+        if (!strcmp(value, list[i]))
+          {
+             not_exist = false;
+             break;
+          }
+     }
+
+   return not_exist;
+}
+
 static void
 _glow_shadow_prop_update(Style_Prop_Data *pd, const char *value)
 {
@@ -1153,6 +1174,13 @@ _glow_shadow_prop_update(Style_Prop_Data *pd, const char 
*value)
           }
         free(style_copy);
 
+        if (!_check_value(font_glow_list, style))
+          {
+             eina_tmpstr_del(style);
+             style = eina_tmpstr_add("none");
+             ERR("Wrong style name. Find who did this loaded Edj-Theme and 
slap his face.");
+          }
+
         if (strstr(style, "shadow"))
           {
              item = _add_shadow_part(pd);

-- 


Reply via email to