edc_parser: code refactoring.

be simpler code.
This commit is contained in:
ChunEon Park 2014-08-26 11:37:34 +09:00
parent 57c52c07ad
commit 1eae977508
1 changed files with 14 additions and 28 deletions

View File

@ -745,27 +745,20 @@ parser_cur_group_name_get(parser_data *pd, Evas_Object *entry,
{
if (pd->thread) ecore_thread_cancel(pd->thread);
const char *text = elm_entry_entry_get(entry);
if (!text) return;
char *utf8 = elm_entry_markup_to_utf8(text);
if (!utf8) return;
cur_name_td *td = calloc(1, sizeof(cur_name_td));
if (!td)
{
free(utf8);
EINA_LOG_ERR("Failed to allocate Memory!");
return;
}
const char *text = elm_entry_entry_get(entry);
if (!text)
{
free(td);
return;
}
char *utf8 = elm_entry_markup_to_utf8(text);
if (!utf8)
{
free(td);
return;
}
td->pd = pd;
td->utf8 = utf8;
td->cur_pos = elm_entry_cursor_pos_get(entry);
@ -785,27 +778,20 @@ parser_cur_name_get(parser_data *pd, Evas_Object *entry, void (*cb)(void *data,
{
if (pd->thread) ecore_thread_cancel(pd->thread);
const char *text = elm_entry_entry_get(entry);
if (!text) return;
char *utf8 = elm_entry_markup_to_utf8(text);
if (!utf8) return;
cur_name_td *td = calloc(1, sizeof(cur_name_td));
if (!td)
{
free(utf8);
EINA_LOG_ERR("Failed to allocate Memory!");
return;
}
const char *text = elm_entry_entry_get(entry);
if (!text)
{
free(td);
return;
}
char *utf8 = elm_entry_markup_to_utf8(text);
if (!utf8)
{
free(td);
return;
}
td->pd = pd;
td->utf8 = utf8;
td->cur_pos = elm_entry_cursor_pos_get(entry);