discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ae16cb648ad50ba45597b5bb08961a012a1e98fa
commit ae16cb648ad50ba45597b5bb08961a012a1e98fa Author: Mike Blumenkrantz <[email protected]> Date: Mon Jan 26 15:02:51 2015 -0500 edje_cc must error when first provided state description is not "default" 0.0 correctly @fix T1926 without breaking existing apps/syntax --- src/bin/edje/edje_cc_handlers.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index aebb953..ab878f6 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -6469,14 +6469,12 @@ st_collections_group_parts_part_description_state(void) Edje_Part *ep; Edje_Part_Description_Common *ed; char *s; + double val; check_min_arg_count(1); ep = current_part; - ed = ep->default_desc; - if (ep->other.desc_count) ed = ep->other.desc[ep->other.desc_count - 1]; - s = parse_str(0); if (!strcmp (s, "custom")) { @@ -6484,13 +6482,25 @@ st_collections_group_parts_part_description_state(void) file_in, line - 1, s); exit(-1); } + if (get_arg_count() == 1) + val = 0.0; + else + val = parse_float_range(1, 0.0, 1.0); + + /* if only default desc exists and current desc is not default, commence paddling */ + if ((!ep->other.desc_count) && (val || (!eina_streq(s, "default")))) + { + ERR("parse error %s:%i. invalid state name: '%s'. \"default\" state must always be first.", + file_in, line - 1, s); + exit(-1); + } + ed = ep->default_desc; + if (ep->other.desc_count) ed = ep->other.desc[ep->other.desc_count - 1]; free((void *)ed->state.name); ed->state.name = s; - if (get_arg_count() == 1) - ed->state.value = 0.0; - else - ed->state.value = parse_float_range(1, 0.0, 1.0); + ed->state.value = val; + _part_description_state_update(ed); } --
