summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-01-26 15:02:51 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-01-26 15:04:19 -0500
commitae16cb648ad50ba45597b5bb08961a012a1e98fa (patch)
tree5c02f9a2c165789b1b8882d913193ab40e3ddf12 /src/bin/edje
parenta5217c7c534407edce180389460b5e8708e7fb02 (diff)
edje_cc must error when first provided state description is not "default" 0.0
correctly @fix T1926 without breaking existing apps/syntax
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/edje_cc_handlers.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index aebb9533cf..ab878f6bc1 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)
6469 Edje_Part *ep; 6469 Edje_Part *ep;
6470 Edje_Part_Description_Common *ed; 6470 Edje_Part_Description_Common *ed;
6471 char *s; 6471 char *s;
6472 double val;
6472 6473
6473 check_min_arg_count(1); 6474 check_min_arg_count(1);
6474 6475
6475 ep = current_part; 6476 ep = current_part;
6476 6477
6477 ed = ep->default_desc;
6478 if (ep->other.desc_count) ed = ep->other.desc[ep->other.desc_count - 1];
6479
6480 s = parse_str(0); 6478 s = parse_str(0);
6481 if (!strcmp (s, "custom")) 6479 if (!strcmp (s, "custom"))
6482 { 6480 {
@@ -6484,13 +6482,25 @@ st_collections_group_parts_part_description_state(void)
6484 file_in, line - 1, s); 6482 file_in, line - 1, s);
6485 exit(-1); 6483 exit(-1);
6486 } 6484 }
6485 if (get_arg_count() == 1)
6486 val = 0.0;
6487 else
6488 val = parse_float_range(1, 0.0, 1.0);
6489
6490 /* if only default desc exists and current desc is not default, commence paddling */
6491 if ((!ep->other.desc_count) && (val || (!eina_streq(s, "default"))))
6492 {
6493 ERR("parse error %s:%i. invalid state name: '%s'. \"default\" state must always be first.",
6494 file_in, line - 1, s);
6495 exit(-1);
6496 }
6497 ed = ep->default_desc;
6498 if (ep->other.desc_count) ed = ep->other.desc[ep->other.desc_count - 1];
6487 6499
6488 free((void *)ed->state.name); 6500 free((void *)ed->state.name);
6489 ed->state.name = s; 6501 ed->state.name = s;
6490 if (get_arg_count() == 1) 6502 ed->state.value = val;
6491 ed->state.value = 0.0; 6503
6492 else
6493 ed->state.value = parse_float_range(1, 0.0, 1.0);
6494 _part_description_state_update(ed); 6504 _part_description_state_update(ed);
6495} 6505}
6496 6506