From fdaee0c842d8c8d3a51110865d2d769384a79c77 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Thu, 14 Apr 2016 21:55:14 +0900 Subject: [PATCH] edje: fix invalid calculation to get a circular dependency Change-Id: Ic0cc0ef774f02a6cec05bb1a5000f1d1cd88ead2 --- src/lib/edje/edje_calc.c | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index f524e12..ca0fee2 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3551,18 +3551,15 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein { Edje_Real_Part *rp = NULL; - if (cep && !strcmp(ep->part->name, cep->part->name)) - { - return EINA_TRUE; - } + if (cep == ep) return EINA_TRUE; + if (!cep) cep = ep; - if ((ep->calculating & FLAG_X)) + if ((cep->calculating & FLAG_X)) { - if (ep->param1.description) + if (cep->param1.description) { - if (ep->param1.description->rel1.id_x >= 0) + if (cep->param1.description->rel1.id_x >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param1.description->rel1.id_x]; if (_circular_dependency_find(ed, ep, rp, clist)) { @@ -3570,9 +3567,8 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein return EINA_TRUE; } } - if (ep->param1.description->rel2.id_x >= 0) + if (cep->param1.description->rel2.id_x >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param1.description->rel2.id_x]; if (_circular_dependency_find(ed, ep, rp, clist)) { @@ -3582,11 +3578,10 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein } } - if (ep->param2) + if (cep->param2) { - if (ep->param2->description->rel1.id_x >= 0) + if (cep->param2->description->rel1.id_x >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param2->description->rel1.id_x]; if (_circular_dependency_find(ed, ep, rp, clist)) { @@ -3594,9 +3589,8 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein return EINA_TRUE; } } - if (ep->param2->description->rel2.id_x >= 0) + if (cep->param2->description->rel2.id_x >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param2->description->rel2.id_x]; if (_circular_dependency_find(ed, ep, rp, clist)) { @@ -3606,13 +3600,12 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein } } } - if ((ep->calculating & FLAG_Y)) + if ((cep->calculating & FLAG_Y)) { - if (ep->param1.description) + if (cep->param1.description) { - if (ep->param1.description->rel1.id_y >= 0) + if (cep->param1.description->rel1.id_y >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param1.description->rel1.id_y]; if (_circular_dependency_find(ed, ep, rp, clist)) { @@ -3620,9 +3613,8 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein return EINA_TRUE; } } - if (ep->param1.description->rel2.id_y >= 0) + if (cep->param1.description->rel2.id_y >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param1.description->rel2.id_y]; if (_circular_dependency_find(ed, ep, rp, clist)) { @@ -3631,11 +3623,10 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein } } } - if (ep->param2) + if (cep->param2) { - if (ep->param2->description->rel1.id_y >= 0) + if (cep->param2->description->rel1.id_y >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param2->description->rel1.id_y]; if (_circular_dependency_find(ed, ep, rp, clist)) { @@ -3643,9 +3634,8 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein return EINA_TRUE; } } - if (ep->param2->description->rel2.id_y >= 0) + if (cep->param2->description->rel2.id_y >= 0) { - if (!cep) cep = ep; rp = ed->table_parts[cep->param2->description->rel2.id_y]; if (_circular_dependency_find(ed, ep, rp, clist)) { -- 2.7.4