live_edit: fix a broken functionality.
edc_parser was unintentionally changed while multi-files support.
This commit is contained in:
parent
4353d98bac
commit
e58c6c7600
|
@ -1306,11 +1306,13 @@ end_of_parts_block_find(const char *pos)
|
|||
static const char *
|
||||
group_beginning_pos_get(const char* source, const char *group_name)
|
||||
{
|
||||
if (!group_name) return NULL;
|
||||
|
||||
const char* GROUP_SYNTAX_NAME = "group";
|
||||
const char *quot = QUOT_UTF8;
|
||||
const int quot_len = QUOT_UTF8_LEN;
|
||||
|
||||
const char *pos = strstr(source, GROUP_SYNTAX_NAME);
|
||||
int group_name_len = strlen(group_name);
|
||||
|
||||
//TODO: Process comments and quotes.
|
||||
while (pos)
|
||||
|
@ -1320,7 +1322,7 @@ group_beginning_pos_get(const char* source, const char *group_name)
|
|||
name += quot_len;
|
||||
pos = strstr(name, quot);
|
||||
if (!pos) return NULL;
|
||||
if (!strncmp(name, group_name, 5))
|
||||
if (!strncmp(name, group_name, group_name_len))
|
||||
return pos;
|
||||
pos = strstr(++pos, GROUP_SYNTAX_NAME);
|
||||
}
|
||||
|
|
|
@ -142,12 +142,11 @@ textblock_style_add(edit_data *ed, const char *style_name)
|
|||
}
|
||||
|
||||
static int
|
||||
template_part_insert_cursor_pos_set(edit_data *ed,
|
||||
template_part_insert_cursor_pos_set(Evas_Object *edit_entry,
|
||||
Enventor_Template_Insert_Type insert_type,
|
||||
const Eina_Stringshare *group_name)
|
||||
{
|
||||
int cursor_pos = -1;
|
||||
Evas_Object *edit_entry = edit_entry_get(ed);
|
||||
if (insert_type == ENVENTOR_TEMPLATE_INSERT_LIVE_EDIT)
|
||||
{
|
||||
cursor_pos = parser_end_of_parts_block_pos_get(edit_entry, group_name);
|
||||
|
@ -198,7 +197,7 @@ template_part_insert(edit_data *ed, Edje_Part_Type part_type,
|
|||
if (insert_type == ENVENTOR_TEMPLATE_INSERT_LIVE_EDIT)
|
||||
group_name = view_group_name_get(VIEW_DATA);
|
||||
|
||||
int cursor_pos = template_part_insert_cursor_pos_set(ed, insert_type,
|
||||
int cursor_pos = template_part_insert_cursor_pos_set(edit_entry, insert_type,
|
||||
group_name);
|
||||
if (cursor_pos == -1) return EINA_FALSE;
|
||||
|
||||
|
|
Loading…
Reference in New Issue