woohyun pushed a commit to branch master.
commit 576a8895e61f84039e58c5ddace4ea1663f69a94
Author: WooHyun Jung <[email protected]>
Date: Thu May 2 14:49:45 2013 +0900
* elm_entry_filter_accept_set function not can recognize tags.
---
ChangeLog | 3 +++
NEWS | 1 +
src/lib/elm_entry.c | 59 +++++++++++++++++++++++++++++++++++++++++++++--------
3 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f1bba65..0fe2307 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1320,3 +1320,6 @@
* Fix elm_object_cursor_theme_search_enabled_set to do as it's name
described.
+2012-05-02 WooHyun Jung
+
+ * elm_entry_filter_accept_set function not can recognize tags.
diff --git a/NEWS b/NEWS
index d317ead..5d53d15 100644
--- a/NEWS
+++ b/NEWS
@@ -221,6 +221,7 @@ Fixes:
* Fix null pointer access on naviframe item deletion.
* Fix the toolbar item clipped problem on reordering items.
* Fix elm_object_cursor_theme_search_enabled_set to do as it's name
described.
+ * Elm_entry_filter_accept_set function now can recognize tags.
Removals:
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 8f904f9..360b66c 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -4303,16 +4303,55 @@ elm_entry_filter_accept_set(void *data,
int cmp_idx, cmp_char;
Eina_Bool in_set = EINA_FALSE;
- cmp_idx = evas_string_char_next_get(set, 0, &cmp_char);
- while (cmp_char)
+ if (read_char == '<')
{
- if (read_char == cmp_char)
+ while (read_char && (read_char != '>'))
+ read_idx = evas_string_char_next_get(*text, read_idx,
&read_char);
+
+ if (goes_in) in_set = EINA_TRUE;
+ else in_set = EINA_FALSE;
+ }
+ else
+ {
+ if (read_char == '&')
{
- in_set = EINA_TRUE;
- break;
+ while (read_char && (read_char != ';'))
+ read_idx = evas_string_char_next_get(*text, read_idx,
&read_char);
+
+ if (!read_char)
+ {
+ if (goes_in) in_set = EINA_TRUE;
+ else in_set = EINA_FALSE;
+ goto inserting;
+ }
+ if (read_char == ';')
+ {
+ char *tag;
+ tag = malloc(read_idx - last_read_idx + 1);
+ if (tag)
+ {
+ strncpy(tag, (*text) + last_read_idx, read_idx -
last_read_idx);
+ tag[read_idx - last_read_idx] = 0;
+ read_char = *(elm_entry_markup_to_utf8(tag));
+ free(tag);
+ }
+ }
+ }
+
+ cmp_idx = evas_string_char_next_get(set, 0, &cmp_char);
+ while (cmp_char)
+ {
+ if (read_char == cmp_char)
+ {
+ in_set = EINA_TRUE;
+ break;
+ }
+ cmp_idx = evas_string_char_next_get(set, cmp_idx, &cmp_char);
}
- cmp_idx = evas_string_char_next_get(set, cmp_idx, &cmp_char);
}
+
+inserting:
+
if (in_set == goes_in)
{
int size = read_idx - last_read_idx;
@@ -4321,8 +4360,12 @@ elm_entry_filter_accept_set(void *data,
memcpy(insert, *text + last_read_idx, size);
insert += size;
}
- last_read_idx = read_idx;
- read_idx = evas_string_char_next_get(*text, read_idx, &read_char);
+
+ if (read_char)
+ {
+ last_read_idx = read_idx;
+ read_idx = evas_string_char_next_get(*text, read_idx, &read_char);
+ }
}
*insert = 0;
}
--
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1