tasn pushed a commit to branch master.
commit 20c0394ba2a1649e8b62daa89f759a41040bc2b8
Author: Tom Hacohen <[email protected]>
Date: Thu May 16 11:04:01 2013 +0100
Edje textblock: Fixed issue with quoted formats. (Fixes T113).
---
ChangeLog | 4 +++
NEWS | 1 +
src/lib/edje/edje_textblock_styles.c | 63 ++++++++++++++++++------------------
3 files changed, 36 insertions(+), 32 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a8d459b..ac89338 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-05-16 Tom Hacohen
+
+ * Edje textblock: Fixed issue with quoted formats.
+
2013-05-14 Jihoon Kim
* Edje entry: return surrounding string until the start position of
selection
diff --git a/NEWS b/NEWS
index 6d6c108..b2bfcb1 100644
--- a/NEWS
+++ b/NEWS
@@ -270,3 +270,4 @@ Fixes:
* Evas: Fix crash if app use native surface in wrong engine.
* Edje entry: return surrounding string until the start position of
selection
* Ecore-imf: fix crash when ecore_imf_context_del is called in
ecore_imf_context_input_panel_callback_call
+ * Edje textblock: Fixed issue with quoted formats.
diff --git a/src/lib/edje/edje_textblock_styles.c
b/src/lib/edje/edje_textblock_styles.c
index 52ea02f..9b1efcd 100644
--- a/src/lib/edje/edje_textblock_styles.c
+++ b/src/lib/edje/edje_textblock_styles.c
@@ -25,44 +25,43 @@ _edje_format_param_parse(char *item, char **key, char **val)
static char *
_edje_format_parse(const char **s)
{
- char *item, *ds;
- const char *p, *ss;
+ const char *p;
const char *s1 = NULL;
const char *s2 = NULL;
+ Eina_Bool quote = EINA_FALSE;
p = *s;
if ((!p) || (*p == 0)) return NULL;
for (;;)
{
- if (!s1)
- {
- if (*p != ' ') s1 = p;
- if (*p == 0) break;
- }
- else if (!s2)
- {
- if ((p > *s) && (p[-1] != '\\'))
- {
- if (*p == ' ') s2 = p;
- }
- if (*p == 0) s2 = p;
- }
- p++;
- if (s1 && s2)
- {
- item = malloc(s2 - s1 + 1);
- if (item)
- {
- for (ds = item, ss = s1; ss < s2; ss++, ds++)
- {
- if ((*ss == '\\') && (ss < (s2 - 1))) ss++;
- *ds = *ss;
- }
- *ds = 0;
- }
- *s = s2;
- return item;
- }
+ if (!s1)
+ {
+ if (*p != ' ') s1 = p;
+ if (*p == 0) break;
+ }
+ else if (!s2)
+ {
+ if (*p == '\'')
+ {
+ quote = !quote;
+ }
+
+ if ((p > *s) && (p[-1] != '\\') && (!quote))
+ {
+ if (*p == ' ') s2 = p;
+ }
+ if (*p == 0) s2 = p;
+ }
+ p++;
+ if (s1 && s2 && (s2 > s1))
+ {
+ size_t len = s2 - s1;
+ char *ret = malloc(len + 1);
+ memcpy(ret, s1, len);
+ ret[len] = '\0';
+ *s = s2;
+ return ret;
+ }
}
*s = p;
return NULL;
@@ -142,7 +141,7 @@ _edje_format_reparse(Edje_File *edf, const char *str,
Edje_Style_Tag **tag_ret)
if (eina_strbuf_length_get(txt)) eina_strbuf_append(txt, " ");
eina_strbuf_append(txt, item);
}
- free(item);
+ free(item);
}
if (tmp)
eina_strbuf_free(tmp);
--
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d