summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-03-18 13:30:55 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-18 13:30:55 +0900
commit4a63c917aa6a2da459a6a5da494227f18dfc46c7 (patch)
treee59ab8fce600e3baf56c6bcc9374450fcdbcdb8d
parentb8f682b842675d8ac952ddbc067befc22ec486ce (diff)
downloadefl-4a63c917aa6a2da459a6a5da494227f18dfc46c7.tar.gz
edje_cc: fix inheriting script from other group
Summary: If a group inherits from the other, group script block is copied only when there are program script blocks in parent group. This patch makes edje_cc always copies group script block, but allows to override group script block in child group. The content of reverted D3799 is included. That reveals this inconsistency. Reviewers: cedric Subscribers: Jaehyun_Cho, woohyun, jpeg Differential Revision: https://phab.enlightenment.org/D3802
-rw-r--r--src/bin/edje/edje_cc_handlers.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 8fb43cf15f..edc3542475 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -163,6 +163,7 @@ static Edje_Part_Description_Common *parent_desc = NULL;
static Edje_Program *current_program = NULL;
static Eina_List *current_program_lookups = NULL;
Eina_Bool current_group_inherit = EINA_FALSE;
+Eina_Bool script_override = EINA_TRUE;
static Edje_Program *sequencing = NULL;
static Eina_List *sequencing_lookups = NULL;
@@ -3874,8 +3875,8 @@ ob_collections_group(void)
current_part = NULL;
current_desc = NULL;
-
current_group_inherit = EINA_FALSE;
+ script_override = EINA_FALSE;
current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
current_de->id = eina_list_count(edje_collections);
@@ -4438,6 +4439,11 @@ st_collections_group_inherit(void)
cd2 = eina_list_nth(codes, de->id);
cd = eina_list_data_get(eina_list_last(codes));
+ cd->is_lua = cd2->is_lua;
+ cd->shared = STRDUP(cd2->shared);
+ cd->original = STRDUP(cd2->original);
+ script_override = EINA_TRUE;
+
EINA_LIST_FOREACH(cd2->programs, l, cp2)
{
cp = mem_alloc(SZ(Code_Program));
@@ -4446,9 +4452,6 @@ st_collections_group_inherit(void)
cp->l2 = cp2->l2;
cp->script = STRDUP(cp2->script);
cp->original = STRDUP(cp2->original);
- cd->is_lua = cd2->is_lua;
- cd->shared = STRDUP(cd2->shared);
- cd->original = STRDUP(cd2->original);
cd->programs = eina_list_append(cd->programs, cp);
data_queue_copied_anonymous_lookup(pc, &(cp2->id), &(cp->id));
}
@@ -4785,9 +4788,18 @@ ob_collections_group_script(void)
cd->l2 = get_verbatim_line2();
if (cd->shared)
{
- ERR("parse error %s:%i. There is already an existing script section for the group",
- file_in, line - 1);
- exit(-1);
+ if (script_override)
+ {
+ free(cd->shared);
+ free(cd->original);
+ script_override = EINA_FALSE;
+ }
+ else
+ {
+ ERR("parse error %s:%i. There is already an existing script section for the group",
+ file_in, line - 1);
+ exit(-1);
+ }
}
cd->shared = s;
cd->original = strdup(s);