Enlightenment CVS committal

Author  : barbieri
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_textblock_styles.c 


Log Message:
Add missing escape of textblock style font.

===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_textblock_styles.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- edje_textblock_styles.c     1 Mar 2008 06:38:09 -0000       1.16
+++ edje_textblock_styles.c     3 Mar 2008 16:10:22 -0000       1.17
@@ -133,6 +133,21 @@
 }
 
 static char *
+_edje_strbuf_append_escaped(char *s, const char *unescaped_s, int *len, int 
*alloc)
+{
+   char *tmp;
+
+   tmp = _edje_str_escape(unescaped_s);
+   if (!tmp)
+     return s;
+
+   s = _edje_strbuf_append(s, tmp, len, alloc);
+   free(tmp);
+
+   return s;
+}
+
+static char *
 _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret)
 {
    char *s2;
@@ -297,12 +312,13 @@
             /* Add font name last to save evas from multiple loads */
             if (tag->font)
               {
+                 const char *f;
+
                  buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
                  buf = _edje_strbuf_append(buf, "font=", &buflen, &bufalloc);
-                 if (found)
-                   buf = _edje_strbuf_append(buf, tc->font, &buflen, 
&bufalloc);
-                 else
-                   buf = _edje_strbuf_append(buf, tag->font, &buflen, 
&bufalloc);
+
+                 f = (found) ? tc->font : tag->font;
+                 buf = _edje_strbuf_append_escaped(buf, f, &buflen, &bufalloc);
               }
             found = 0;
 
@@ -441,15 +457,9 @@
             /* Add font name last to save evas from multiple loads */
             if (tag->font)
               {
-                 char *tmp;
                  buf = _edje_strbuf_append(buf, " ", &buflen, &bufalloc);
                  buf = _edje_strbuf_append(buf, "font=", &buflen, &bufalloc);
-                 tmp = _edje_str_escape(tag->font);
-                 if (tmp)
-                   {
-                      buf = _edje_strbuf_append(buf, tmp, &buflen, &bufalloc);
-                      free(tmp);
-                   }
+                 buf = _edje_strbuf_append_escaped(buf, tag->font, &buflen, 
&bufalloc);
               }
             buf = _edje_strbuf_append(buf, "'", &buflen, &bufalloc);
          }



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to