summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/edje/edje_entry.c60
3 files changed, 24 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index d203df5c99..ae060daaa9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-02-04 Jihoon Kim (jihoon)
2
3 * edje entry : Support &, < and > in preedit string.
4
12013-02-02 Chidambar Zinnoury (ilLogict) 52013-02-02 Chidambar Zinnoury (ilLogict)
2 * Update French translation. 6 * Update French translation.
3 7
diff --git a/NEWS b/NEWS
index c88cf32151..c001a838be 100644
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,7 @@ Improvements:
92 * edje entry : Remove ecore_imf_context_cursor_position_set in functions related to selection. 92 * edje entry : Remove ecore_imf_context_cursor_position_set in functions related to selection.
93 * Translations updates: 93 * Translations updates:
94 - french. 94 - french.
95 * edje entry : Support &, < and > in preedit string
95 96
96Fixes: 97Fixes:
97 * Fix a memory leak in ecore_con_dns when using ecore_con_server_connect 98 * Fix a memory leak in ecore_con_dns when using ecore_con_server_connect
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 70ef36ce88..f6a5560da2 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -3739,11 +3739,16 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA
3739 int cursor_pos; 3739 int cursor_pos;
3740 int preedit_start_pos, preedit_end_pos; 3740 int preedit_start_pos, preedit_end_pos;
3741 char *preedit_string; 3741 char *preedit_string;
3742 char *markup_txt = NULL;
3743 char *tagname[] = {"", "preedit", "preedit_sel", "preedit_sel",
3744 "preedit_sub1", "preedit_sub2", "preedit_sub3", "preedit_sub4"};
3742 int i; 3745 int i;
3746 size_t preedit_type_size = sizeof(tagname) / sizeof(tagname[0]);
3743 Eina_Bool preedit_end_state = EINA_FALSE; 3747 Eina_Bool preedit_end_state = EINA_FALSE;
3744 Eina_List *attrs = NULL, *l = NULL; 3748 Eina_List *attrs = NULL, *l = NULL;
3745 Ecore_IMF_Preedit_Attr *attr; 3749 Ecore_IMF_Preedit_Attr *attr;
3746 Eina_Strbuf *buf; 3750 Eina_Strbuf *buf;
3751 Eina_Strbuf *preedit_attr_str;
3747 3752
3748 if ((!rp)) return; 3753 if ((!rp)) return;
3749 3754
@@ -3784,49 +3789,22 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA
3784 { 3789 {
3785 EINA_LIST_FOREACH(attrs, l, attr) 3790 EINA_LIST_FOREACH(attrs, l, attr)
3786 { 3791 {
3787 if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1) 3792 if (attr->preedit_type > ECORE_IMF_PREEDIT_TYPE_NONE &&
3793 attr->preedit_type <= preedit_type_size)
3788 { 3794 {
3789 eina_strbuf_append(buf, "<preedit>"); 3795 preedit_attr_str = eina_strbuf_new();
3790 eina_strbuf_append_n(buf, preedit_string + attr->start_index, 3796 if (preedit_attr_str)
3791 attr->end_index - attr->start_index); 3797 {
3792 eina_strbuf_append(buf, "</preedit>"); 3798 eina_strbuf_append_n(preedit_attr_str, preedit_string + attr->start_index, attr->end_index - attr->start_index);
3793 } 3799 markup_txt = evas_textblock_text_utf8_to_markup(NULL, eina_strbuf_string_get(preedit_attr_str));
3794 3800
3795 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2 || 3801 if (markup_txt)
3796 attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3) 3802 {
3797 { 3803 eina_strbuf_append_printf(buf, "<%s>%s</%s>", tagname[attr->preedit_type], markup_txt, tagname[attr->preedit_type]);
3798 eina_strbuf_append(buf, "<preedit_sel>"); 3804 free(markup_txt);
3799 eina_strbuf_append_n(buf, preedit_string + attr->start_index, 3805 }
3800 attr->end_index - attr->start_index); 3806 eina_strbuf_free(preedit_attr_str);
3801 eina_strbuf_append(buf, "</preedit_sel>"); 3807 }
3802 }
3803 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB4)
3804 {
3805 eina_strbuf_append(buf, "<preedit_sub1>");
3806 eina_strbuf_append_n(buf, preedit_string + attr->start_index,
3807 attr->end_index - attr->start_index);
3808 eina_strbuf_append(buf, "</preedit_sub1>");
3809 }
3810 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB5)
3811 {
3812 eina_strbuf_append(buf, "<preedit_sub2>");
3813 eina_strbuf_append_n(buf, preedit_string + attr->start_index,
3814 attr->end_index - attr->start_index);
3815 eina_strbuf_append(buf, "</preedit_sub2>");
3816 }
3817 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB6)
3818 {
3819 eina_strbuf_append(buf, "<preedit_sub3>");
3820 eina_strbuf_append_n(buf, preedit_string + attr->start_index,
3821 attr->end_index - attr->start_index);
3822 eina_strbuf_append(buf, "</preedit_sub3>");
3823 }
3824 else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB7)
3825 {
3826 eina_strbuf_append(buf, "<preedit_sub4>");
3827 eina_strbuf_append_n(buf, preedit_string + attr->start_index,
3828 attr->end_index - attr->start_index);
3829 eina_strbuf_append(buf, "</preedit_sub4>");
3830 } 3808 }
3831 } 3809 }
3832 } 3810 }