summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-10 14:24:53 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-07-10 14:40:42 -0400
commitf5d3f575c6b77e882ec26f9910276cf9ab1c299d (patch)
tree2869d89b35fb1e4d882ea4eeb06c919d27df160d
parent66213df2f5a537b670cf48a52a71c8160fa4bb26 (diff)
edje: improve user-defined data caching to handle data before file is set
Summary: this adds explicit handling for things like: efl_add(SOMECLASS, parent, efl_text_set(efl_added, "my text") ); on edje-inheriting objects. note that it's still impossible to do something like efl_add(SOMECLASS, parent, efl_text_set(efl_part(efl_added, "somepart"), "my text") ); also add a unit test to verify common behaviors @feature Depends on D9209 Reviewers: cedric Reviewed By: cedric Subscribers: bu5hm4n, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9210
-rw-r--r--src/lib/edje/edje_load.c5
-rw-r--r--src/lib/edje/edje_util.c162
-rw-r--r--src/tests/elementary/efl_ui_test_layout.c17
3 files changed, 132 insertions, 52 deletions
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 0e257a902d..5170411700 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -779,6 +779,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
779 int group_path_started = 0; 779 int group_path_started = 0;
780 Evas_Object *nested_smart = NULL; 780 Evas_Object *nested_smart = NULL;
781 char lang[PATH_MAX]; 781 char lang[PATH_MAX];
782 Eina_Bool had_file;
782 Eina_Hash *part_match = NULL; 783 Eina_Hash *part_match = NULL;
783 784
784 /* Get data pointer of top-of-stack */ 785 /* Get data pointer of top-of-stack */
@@ -793,6 +794,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
793 { 794 {
794 return 0; 795 return 0;
795 } 796 }
797 had_file = !!ed->file;
796 798
797 tev = evas_object_evas_get(obj); 799 tev = evas_object_evas_get(obj);
798 evas_event_freeze(tev); 800 evas_event_freeze(tev);
@@ -1696,6 +1698,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
1696 break; 1698 break;
1697 } 1699 }
1698 eina_stringshare_del(eud->u.string.text); 1700 eina_stringshare_del(eud->u.string.text);
1701 /* string has extra ref in this case */
1702 if (!had_file)
1703 eina_stringshare_del(eud->u.string.text);
1699 break; 1704 break;
1700 1705
1701 case EDJE_USER_TEXT_STYLE: 1706 case EDJE_USER_TEXT_STYLE:
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 827c95c0d1..5b5692beb3 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -2103,6 +2103,12 @@ _edje_efl_text_text_set(Eo *obj, Edje *ed, const char *part, const char *text,
2103 Eina_Bool int_ret; 2103 Eina_Bool int_ret;
2104 2104
2105 if ((!ed) || (!part)) return EINA_FALSE; 2105 if ((!ed) || (!part)) return EINA_FALSE;
2106 if ((!ed->file) && (!legacy))
2107 {
2108 _edje_user_define_string(ed, part, eina_stringshare_add(text),
2109 set_markup ? EDJE_TEXT_TYPE_MARKUP : EDJE_TEXT_TYPE_NORMAL);
2110 return EINA_TRUE;
2111 }
2106 rp = _edje_real_part_recursive_get(&ed, part); 2112 rp = _edje_real_part_recursive_get(&ed, part);
2107 if (!rp) return EINA_FALSE; 2113 if (!rp) return EINA_FALSE;
2108 if ((rp->part->type != EDJE_PART_TYPE_TEXT) && 2114 if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
@@ -3035,6 +3041,16 @@ _edje_efl_content_content_set(Edje *ed, const char *part, Efl_Gfx_Entity *obj_sw
3035 } 3041 }
3036 } 3042 }
3037 3043
3044 if (!ed->file)
3045 {
3046 eud = _edje_user_definition_new(EDJE_USER_SWALLOW, part, ed);
3047 if (eud)
3048 {
3049 evas_object_event_callback_add(obj_swallow, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
3050 eud->u.swallow.child = obj_swallow;
3051 }
3052 return EINA_TRUE;
3053 }
3038 if (!rp) 3054 if (!rp)
3039 { 3055 {
3040 DBG("cannot swallow part %s: part not exist!", part); 3056 DBG("cannot swallow part %s: part not exist!", part);
@@ -3919,14 +3935,17 @@ _edje_object_part_drag_dir_get(Edje *ed, const char *part)
3919Eina_Bool 3935Eina_Bool
3920_edje_object_part_drag_value_set(Edje *ed, const char *part, double dx, double dy) 3936_edje_object_part_drag_value_set(Edje *ed, const char *part, double dx, double dy)
3921{ 3937{
3922 Edje_Real_Part *rp; 3938 Edje_Real_Part *rp = NULL;
3923 Edje_User_Defined *eud; 3939 Edje_User_Defined *eud;
3924 Eina_List *l, *ll; 3940 Eina_List *l, *ll;
3925 3941
3926 if ((!ed) || (!part)) return EINA_FALSE; 3942 if ((!ed) || (!part)) return EINA_FALSE;
3927 rp = _edje_real_part_recursive_get(&ed, part); 3943 if (ed->file)
3928 if (!rp) return EINA_FALSE; 3944 {
3929 if (!rp->drag) return EINA_FALSE; 3945 rp = _edje_real_part_recursive_get(&ed, part);
3946 if (!rp) return EINA_FALSE;
3947 if (!rp->drag) return EINA_FALSE;
3948 }
3930 3949
3931 l = eina_hash_find(ed->user_defined, part); 3950 l = eina_hash_find(ed->user_defined, part);
3932 EINA_LIST_FOREACH(l, ll, eud) 3951 EINA_LIST_FOREACH(l, ll, eud)
@@ -3945,6 +3964,7 @@ _edje_object_part_drag_value_set(Edje *ed, const char *part, double dx, double d
3945 eud->u.drag_position.y = dy; 3964 eud->u.drag_position.y = dy;
3946 } 3965 }
3947 } 3966 }
3967 if (!ed->file) return EINA_TRUE;
3948 3968
3949 if (rp->part->dragable.confine_id != -1) 3969 if (rp->part->dragable.confine_id != -1)
3950 { 3970 {
@@ -4005,14 +4025,17 @@ _edje_object_part_drag_value_get(Edje *ed, const char *part, double *dx, double
4005Eina_Bool 4025Eina_Bool
4006_edje_object_part_drag_size_set(Edje *ed, const char *part, double dw, double dh) 4026_edje_object_part_drag_size_set(Edje *ed, const char *part, double dw, double dh)
4007{ 4027{
4008 Edje_Real_Part *rp; 4028 Edje_Real_Part *rp = NULL;
4009 Edje_User_Defined *eud; 4029 Edje_User_Defined *eud;
4010 Eina_List *l, *ll; 4030 Eina_List *l, *ll;
4011 4031
4012 if ((!ed) || (!part)) return EINA_FALSE; 4032 if ((!ed) || (!part)) return EINA_FALSE;
4013 rp = _edje_real_part_recursive_get(&ed, part); 4033 rp = _edje_real_part_recursive_get(&ed, part);
4014 if (!rp) return EINA_FALSE; 4034 if (ed->file)
4015 if (!rp->drag) return EINA_FALSE; 4035 {
4036 if (!rp) return EINA_FALSE;
4037 if (!rp->drag) return EINA_FALSE;
4038 }
4016 4039
4017 l = eina_hash_find(ed->user_defined, part); 4040 l = eina_hash_find(ed->user_defined, part);
4018 EINA_LIST_FOREACH(l, ll, eud) 4041 EINA_LIST_FOREACH(l, ll, eud)
@@ -4031,6 +4054,7 @@ _edje_object_part_drag_size_set(Edje *ed, const char *part, double dw, double dh
4031 eud->u.drag_size.h = dh; 4054 eud->u.drag_size.h = dh;
4032 } 4055 }
4033 } 4056 }
4057 if (!ed->file) return EINA_TRUE;
4034 4058
4035 if (dw < 0.0) dw = 0.0; 4059 if (dw < 0.0) dw = 0.0;
4036 else if (dw > 1.0) 4060 else if (dw > 1.0)
@@ -4085,14 +4109,17 @@ _edje_object_part_drag_size_get(Edje *ed, const char *part, double *dw, double *
4085Eina_Bool 4109Eina_Bool
4086_edje_object_part_drag_step_set(Edje *ed, const char *part, double dx, double dy) 4110_edje_object_part_drag_step_set(Edje *ed, const char *part, double dx, double dy)
4087{ 4111{
4088 Edje_Real_Part *rp; 4112 Edje_Real_Part *rp = NULL;
4089 Edje_User_Defined *eud; 4113 Edje_User_Defined *eud;
4090 Eina_List *l, *ll; 4114 Eina_List *l, *ll;
4091 4115
4092 if ((!ed) || (!part)) return EINA_FALSE; 4116 if ((!ed) || (!part)) return EINA_FALSE;
4093 rp = _edje_real_part_recursive_get(&ed, part); 4117 rp = _edje_real_part_recursive_get(&ed, part);
4094 if (!rp) return EINA_FALSE; 4118 if (ed->file)
4095 if (!rp->drag) return EINA_FALSE; 4119 {
4120 if (!rp) return EINA_FALSE;
4121 if (!rp->drag) return EINA_FALSE;
4122 }
4096 4123
4097 l = eina_hash_find(ed->user_defined, part); 4124 l = eina_hash_find(ed->user_defined, part);
4098 EINA_LIST_FOREACH(l, ll, eud) 4125 EINA_LIST_FOREACH(l, ll, eud)
@@ -4111,6 +4138,7 @@ _edje_object_part_drag_step_set(Edje *ed, const char *part, double dx, double dy
4111 eud->u.drag_position.y = dy; 4138 eud->u.drag_position.y = dy;
4112 } 4139 }
4113 } 4140 }
4141 if (!ed->file) return EINA_TRUE;
4114 4142
4115 if (dx < 0.0) dx = 0.0; 4143 if (dx < 0.0) dx = 0.0;
4116 else if (dx > 1.0) 4144 else if (dx > 1.0)
@@ -4158,14 +4186,17 @@ _edje_object_part_drag_step_get(Edje *ed, const char *part, double *dx, double *
4158Eina_Bool 4186Eina_Bool
4159_edje_object_part_drag_page_set(Edje *ed, const char *part, double dx, double dy) 4187_edje_object_part_drag_page_set(Edje *ed, const char *part, double dx, double dy)
4160{ 4188{
4161 Edje_Real_Part *rp; 4189 Edje_Real_Part *rp = NULL;
4162 Edje_User_Defined *eud; 4190 Edje_User_Defined *eud;
4163 Eina_List *l, *ll; 4191 Eina_List *l, *ll;
4164 4192
4165 if ((!ed) || (!part)) return EINA_FALSE; 4193 if ((!ed) || (!part)) return EINA_FALSE;
4166 rp = _edje_real_part_recursive_get(&ed, part); 4194 if (ed->file)
4167 if (!rp) return EINA_FALSE; 4195 {
4168 if (!rp->drag) return EINA_FALSE; 4196 rp = _edje_real_part_recursive_get(&ed, part);
4197 if (!rp) return EINA_FALSE;
4198 if (!rp->drag) return EINA_FALSE;
4199 }
4169 4200
4170 l = eina_hash_find(ed->user_defined, part); 4201 l = eina_hash_find(ed->user_defined, part);
4171 EINA_LIST_FOREACH(l, ll, eud) 4202 EINA_LIST_FOREACH(l, ll, eud)
@@ -4184,6 +4215,7 @@ _edje_object_part_drag_page_set(Edje *ed, const char *part, double dx, double dy
4184 eud->u.drag_position.y = dy; 4215 eud->u.drag_position.y = dy;
4185 } 4216 }
4186 } 4217 }
4218 if (!ed->file) return EINA_TRUE;
4187 4219
4188 if (dx < 0.0) dx = 0.0; 4220 if (dx < 0.0) dx = 0.0;
4189 else if (dx > 1.0) 4221 else if (dx > 1.0)
@@ -4231,15 +4263,18 @@ _edje_object_part_drag_page_get(Edje *ed, const char *part, double *dx, double *
4231Eina_Bool 4263Eina_Bool
4232_edje_object_part_drag_step(Edje *ed, const char *part, double dx, double dy) 4264_edje_object_part_drag_step(Edje *ed, const char *part, double dx, double dy)
4233{ 4265{
4234 Edje_Real_Part *rp; 4266 Edje_Real_Part *rp = NULL;
4235 FLOAT_T px, py; 4267 FLOAT_T px, py;
4236 Edje_User_Defined *eud; 4268 Edje_User_Defined *eud;
4237 Eina_List *l, *ll; 4269 Eina_List *l, *ll;
4238 4270
4239 if ((!ed) || (!part)) return EINA_FALSE; 4271 if ((!ed) || (!part)) return EINA_FALSE;
4240 rp = _edje_real_part_recursive_get(&ed, part); 4272 if (ed->file)
4241 if (!rp) return EINA_FALSE; 4273 {
4242 if (!rp->drag) return EINA_FALSE; 4274 rp = _edje_real_part_recursive_get(&ed, part);
4275 if (!rp) return EINA_FALSE;
4276 if (!rp->drag) return EINA_FALSE;
4277 }
4243 4278
4244 l = eina_hash_find(ed->user_defined, part); 4279 l = eina_hash_find(ed->user_defined, part);
4245 EINA_LIST_FOREACH(l, ll, eud) 4280 EINA_LIST_FOREACH(l, ll, eud)
@@ -4258,6 +4293,7 @@ _edje_object_part_drag_step(Edje *ed, const char *part, double dx, double dy)
4258 eud->u.drag_position.y = dy; 4293 eud->u.drag_position.y = dy;
4259 } 4294 }
4260 } 4295 }
4296 if (!ed->file) return EINA_TRUE;
4261 4297
4262 px = rp->drag->val.x; 4298 px = rp->drag->val.x;
4263 py = rp->drag->val.y; 4299 py = rp->drag->val.y;
@@ -4283,15 +4319,18 @@ _edje_object_part_drag_step(Edje *ed, const char *part, double dx, double dy)
4283Eina_Bool 4319Eina_Bool
4284_edje_object_part_drag_page(Edje *ed, const char *part, double dx, double dy) 4320_edje_object_part_drag_page(Edje *ed, const char *part, double dx, double dy)
4285{ 4321{
4286 Edje_Real_Part *rp; 4322 Edje_Real_Part *rp = NULL;
4287 FLOAT_T px, py; 4323 FLOAT_T px, py;
4288 Edje_User_Defined *eud; 4324 Edje_User_Defined *eud;
4289 Eina_List *l, *ll; 4325 Eina_List *l, *ll;
4290 4326
4291 if ((!ed) || (!part)) return EINA_FALSE; 4327 if ((!ed) || (!part)) return EINA_FALSE;
4292 rp = _edje_real_part_recursive_get(&ed, part); 4328 if (ed->file)
4293 if (!rp) return EINA_FALSE; 4329 {
4294 if (!rp->drag) return EINA_FALSE; 4330 rp = _edje_real_part_recursive_get(&ed, part);
4331 if (!rp) return EINA_FALSE;
4332 if (!rp->drag) return EINA_FALSE;
4333 }
4295 4334
4296 l = eina_hash_find(ed->user_defined, part); 4335 l = eina_hash_find(ed->user_defined, part);
4297 EINA_LIST_FOREACH(l, ll, eud) 4336 EINA_LIST_FOREACH(l, ll, eud)
@@ -4310,6 +4349,7 @@ _edje_object_part_drag_page(Edje *ed, const char *part, double dx, double dy)
4310 eud->u.drag_position.y = dy; 4349 eud->u.drag_position.y = dy;
4311 } 4350 }
4312 } 4351 }
4352 if (!ed->file) return EINA_TRUE;
4313 4353
4314 px = rp->drag->val.x; 4354 px = rp->drag->val.x;
4315 py = rp->drag->val.y; 4355 py = rp->drag->val.y;
@@ -4350,16 +4390,19 @@ Eina_Bool
4350_edje_part_box_append(Edje *ed, const char *part, Evas_Object *child) 4390_edje_part_box_append(Edje *ed, const char *part, Evas_Object *child)
4351{ 4391{
4352 Eina_Bool ret; 4392 Eina_Bool ret;
4353 Edje_Real_Part *rp; 4393 Edje_Real_Part *rp = NULL;
4354 ret = EINA_FALSE; 4394 ret = EINA_FALSE;
4355 4395
4356 if ((!ed) || (!part) || (!child)) return ret; 4396 if ((!ed) || (!part) || (!child)) return ret;
4357 4397
4358 rp = _edje_real_part_recursive_get(&ed, part); 4398 if (ed->file)
4359 if (!rp) return ret; 4399 {
4360 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret; 4400 rp = _edje_real_part_recursive_get(&ed, part);
4401 if (!rp) return ret;
4402 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret;
4403 }
4361 4404
4362 if (_edje_real_part_box_append(ed, rp, child)) 4405 if ((!ed->file) || _edje_real_part_box_append(ed, rp, child))
4363 { 4406 {
4364 Edje_User_Defined *eud; 4407 Edje_User_Defined *eud;
4365 4408
@@ -4379,16 +4422,19 @@ Eina_Bool
4379_edje_part_box_prepend(Edje *ed, const char *part, Evas_Object *child) 4422_edje_part_box_prepend(Edje *ed, const char *part, Evas_Object *child)
4380{ 4423{
4381 Eina_Bool ret; 4424 Eina_Bool ret;
4382 Edje_Real_Part *rp; 4425 Edje_Real_Part *rp = NULL;
4383 ret = EINA_FALSE; 4426 ret = EINA_FALSE;
4384 4427
4385 if ((!ed) || (!part)) return ret; 4428 if ((!ed) || (!part)) return ret;
4386 4429
4387 rp = _edje_real_part_recursive_get(&ed, part); 4430 if (ed->file)
4388 if (!rp) return ret; 4431 {
4389 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret; 4432 rp = _edje_real_part_recursive_get(&ed, part);
4433 if (!rp) return ret;
4434 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret;
4435 }
4390 4436
4391 if (_edje_real_part_box_prepend(ed, rp, child)) 4437 if ((!ed->file) || _edje_real_part_box_prepend(ed, rp, child))
4392 { 4438 {
4393 Edje_User_Defined *eud; 4439 Edje_User_Defined *eud;
4394 4440
@@ -4407,16 +4453,19 @@ Eina_Bool
4407_edje_part_box_insert_before(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference) 4453_edje_part_box_insert_before(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference)
4408{ 4454{
4409 Eina_Bool ret; 4455 Eina_Bool ret;
4410 Edje_Real_Part *rp; 4456 Edje_Real_Part *rp = NULL;
4411 ret = EINA_FALSE; 4457 ret = EINA_FALSE;
4412 4458
4413 if ((!ed) || (!part)) return ret; 4459 if ((!ed) || (!part)) return ret;
4414 4460
4415 rp = _edje_real_part_recursive_get(&ed, part); 4461 if (ed->file)
4416 if (!rp) return ret; 4462 {
4417 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret; 4463 rp = _edje_real_part_recursive_get(&ed, part);
4464 if (!rp) return ret;
4465 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret;
4466 }
4418 4467
4419 if (_edje_real_part_box_insert_before(ed, rp, child, reference)) 4468 if ((!ed->file) || _edje_real_part_box_insert_before(ed, rp, child, reference))
4420 { 4469 {
4421 Edje_User_Defined *eud; 4470 Edje_User_Defined *eud;
4422 4471
@@ -4435,16 +4484,19 @@ Eina_Bool
4435_edje_part_box_insert_after(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference) 4484_edje_part_box_insert_after(Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference)
4436{ 4485{
4437 Eina_Bool ret; 4486 Eina_Bool ret;
4438 Edje_Real_Part *rp; 4487 Edje_Real_Part *rp = NULL;
4439 ret = EINA_FALSE; 4488 ret = EINA_FALSE;
4440 4489
4441 if ((!ed) || (!part)) return ret; 4490 if ((!ed) || (!part)) return ret;
4442 4491
4443 rp = _edje_real_part_recursive_get(&ed, part); 4492 if (ed->file)
4444 if (!rp) return ret; 4493 {
4445 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret; 4494 rp = _edje_real_part_recursive_get(&ed, part);
4495 if (!rp) return ret;
4496 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret;
4497 }
4446 4498
4447 if (_edje_real_part_box_insert_after(ed, rp, child, reference)) 4499 if ((!ed->file) || _edje_real_part_box_insert_after(ed, rp, child, reference))
4448 { 4500 {
4449 Edje_User_Defined *eud; 4501 Edje_User_Defined *eud;
4450 4502
@@ -4463,16 +4515,19 @@ Eina_Bool
4463_edje_part_box_insert_at(Edje *ed, const char *part, Evas_Object *child, unsigned int pos) 4515_edje_part_box_insert_at(Edje *ed, const char *part, Evas_Object *child, unsigned int pos)
4464{ 4516{
4465 Eina_Bool ret; 4517 Eina_Bool ret;
4466 Edje_Real_Part *rp; 4518 Edje_Real_Part *rp = NULL;
4467 ret = EINA_FALSE; 4519 ret = EINA_FALSE;
4468 4520
4469 if ((!ed) || (!part)) return ret; 4521 if ((!ed) || (!part)) return ret;
4470 4522
4471 rp = _edje_real_part_recursive_get(&ed, part); 4523 if (ed->file)
4472 if (!rp) return ret; 4524 {
4473 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret; 4525 rp = _edje_real_part_recursive_get(&ed, part);
4526 if (!rp) return ret;
4527 if (rp->part->type != EDJE_PART_TYPE_BOX) return ret;
4528 }
4474 4529
4475 if (_edje_real_part_box_insert_at(ed, rp, child, pos)) 4530 if ((!ed->file) || _edje_real_part_box_insert_at(ed, rp, child, pos))
4476 { 4531 {
4477 Edje_User_Defined *eud; 4532 Edje_User_Defined *eud;
4478 4533
@@ -4919,17 +4974,20 @@ Eina_Bool
4919_edje_part_table_pack(Edje *ed, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) 4974_edje_part_table_pack(Edje *ed, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
4920{ 4975{
4921 Eina_Bool ret; 4976 Eina_Bool ret;
4922 Edje_Real_Part *rp; 4977 Edje_Real_Part *rp = NULL;
4923 Edje_User_Defined *eud; 4978 Edje_User_Defined *eud;
4924 ret = EINA_FALSE; 4979 ret = EINA_FALSE;
4925 4980
4926 if ((!ed) || (!part)) return ret; 4981 if ((!ed) || (!part)) return ret;
4927 4982
4928 rp = _edje_real_part_recursive_get(&ed, part); 4983 if (ed->file)
4929 if (!rp) return ret; 4984 {
4930 if (rp->part->type != EDJE_PART_TYPE_TABLE) return ret; 4985 rp = _edje_real_part_recursive_get(&ed, part);
4986 if (!rp) return ret;
4987 if (rp->part->type != EDJE_PART_TYPE_TABLE) return ret;
4988 }
4931 4989
4932 if (_edje_real_part_table_pack(ed, rp, child_obj, col, row, colspan, rowspan)) 4990 if ((!ed->file) || _edje_real_part_table_pack(ed, rp, child_obj, col, row, colspan, rowspan))
4933 { 4991 {
4934 ret = EINA_TRUE; 4992 ret = EINA_TRUE;
4935 eud = _edje_user_definition_new(EDJE_USER_TABLE_PACK, part, ed); 4993 eud = _edje_user_definition_new(EDJE_USER_TABLE_PACK, part, ed);
diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c
index 8f52408cc4..20581d4ae6 100644
--- a/src/tests/elementary/efl_ui_test_layout.c
+++ b/src/tests/elementary/efl_ui_test_layout.c
@@ -106,6 +106,22 @@ EFL_START_TEST(efl_ui_layout_test_layout_theme)
106} 106}
107EFL_END_TEST 107EFL_END_TEST
108 108
109EFL_START_TEST(efl_ui_layout_test_api_ordering)
110{
111 Evas_Object *win, *box;
112 const char text_text[] = "test text";
113
114 win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC);
115 box = efl_add(EFL_UI_BOX_CLASS, win);
116 Eo *layout = efl_add(EFL_UI_BUTTON_CLASS, win,
117 efl_content_set(efl_added, box),
118 efl_text_set(efl_added, text_text)
119 );
120 ck_assert_ptr_eq(efl_content_get(layout), box);
121 ck_assert_str_eq(efl_text_get(layout), text_text);
122}
123EFL_END_TEST
124
109void efl_ui_test_layout(TCase *tc) 125void efl_ui_test_layout(TCase *tc)
110{ 126{
111 tcase_add_test(tc, efl_ui_layout_test_property_bind); 127 tcase_add_test(tc, efl_ui_layout_test_property_bind);
@@ -113,4 +129,5 @@ void efl_ui_test_layout(TCase *tc)
113 tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints); 129 tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints);
114 tcase_add_test(tc, efl_ui_layout_test_layout_force); 130 tcase_add_test(tc, efl_ui_layout_test_layout_force);
115 tcase_add_test(tc, efl_ui_layout_test_layout_theme); 131 tcase_add_test(tc, efl_ui_layout_test_layout_theme);
132 tcase_add_test(tc, efl_ui_layout_test_api_ordering);
116} 133}