From fe48ac5af743439001f78e86fd6098b244a35fbf Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Thu, 12 Feb 2015 22:31:45 +0900 Subject: [PATCH] edc_parser: Fix to enable inserting templates by live edit. The problem that template is not inserted by live edit was caused by the wrong double quotation marks parser. The double quotation marks are written as ""e;" in entry markup format and they are written as "\"" in utf8 format. Previously, only ""e;" was used to parse double quotation marks. Now, ""e;" is used in entry markup format and "\"" is used in utf8 format to parse double quotation marks. --- src/lib/edc_parser.c | 20 ++++++++++---------- src/lib/enventor_private.h | 2 ++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lib/edc_parser.c b/src/lib/edc_parser.c index 549393a..4731483 100644 --- a/src/lib/edc_parser.c +++ b/src/lib/edc_parser.c @@ -50,9 +50,9 @@ typedef struct type_init_thread_data_s static void group_name_thread_blocking(void *data, Ecore_Thread *thread EINA_UNUSED) { - const char *quot = QUOT; + const char *quot = QUOT_UTF8; const char *group = "group"; - const int quot_len = QUOT_LEN; + const int quot_len = QUOT_UTF8_LEN; const int group_len = 5; //strlen("group"); cur_name_td *td = data; @@ -122,11 +122,11 @@ end: static void cur_name_thread_blocking(void *data, Ecore_Thread *thread EINA_UNUSED) { - const char *quot = QUOT; + const char *quot = QUOT_UTF8; const char *part = "part"; const char *parts = "parts"; const char *group = "group"; - const int quot_len = QUOT_LEN; + const int quot_len = QUOT_UTF8_LEN; const int part_len = 4; //strlen("part"); const int parts_len = 5; //strlen("parts"); const int group_len = 5; //strlen("group"); @@ -850,8 +850,8 @@ static const char * group_beginning_pos_get(const char* source, const char *group_name) { const char* GROUP_SYNTAX_NAME = "group"; - const char *quot = QUOT; - const int quot_len = QUOT_LEN; + const char *quot = QUOT_UTF8; + const int quot_len = QUOT_UTF8_LEN; const char *pos = strstr(source, GROUP_SYNTAX_NAME); @@ -1045,8 +1045,8 @@ parser_paragh_name_get(parser_data *pd EINA_UNUSED, Evas_Object *entry) int cur_pos = elm_entry_cursor_pos_get(entry); if (cur_pos < 1) return NULL; - const char *quot = QUOT; - int quot_len = QUOT_LEN; + const char *quot = QUOT_UTF8; + int quot_len = QUOT_UTF8_LEN; char *cur = utf8; char *end = cur + cur_pos; char *stack[20]; @@ -1098,8 +1098,8 @@ parser_paragh_name_get(parser_data *pd EINA_UNUSED, Evas_Object *entry) Eina_Stringshare* parser_cur_name_fast_get(Evas_Object *entry, const char *scope) { - const char *quot = QUOT; - const int quot_len = QUOT_LEN; + const char *quot = QUOT_UTF8; + const int quot_len = QUOT_UTF8_LEN; const int scope_len = strlen(scope); const char *text = elm_entry_entry_get(entry); diff --git a/src/lib/enventor_private.h b/src/lib/enventor_private.h index 925a88f..11eb855 100644 --- a/src/lib/enventor_private.h +++ b/src/lib/enventor_private.h @@ -3,6 +3,8 @@ #define QUOT """ #define QUOT_LEN 6 +#define QUOT_UTF8 "\"" +#define QUOT_UTF8_LEN 1 #define EOL "
" #define EOL_LEN 5 #define TAB ""