summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2014-09-22 14:13:17 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-09-22 14:59:27 +0200
commit51a5f852c22a1763d77ea8e555d7a261f9a4c2fb (patch)
tree43e8420ce8e17d027bc21caae3a6f738a1742001
parente520d3128edcdc1f8d1270107001886a3852a91f (diff)
edje: Edje_Edit: add missing part type checks
Summary: added necessary type checks before using typedata Reviewers: seoz, Hermet, cedric Subscribers: cedric, reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D1464 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/edje/edje_edit.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 3aec4bc..2147d26 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -3114,9 +3114,11 @@ edje_edit_part_del(Evas_Object *obj, const char* part)
3114 if (i == id) continue; //don't check the deleted id 3114 if (i == id) continue; //don't check the deleted id
3115 real = ed->table_parts[i]; 3115 real = ed->table_parts[i];
3116 3116
3117 if ((real->typedata.text) && (real->typedata.text->source == rp)) 3117 if ((rp->type == EDJE_RP_TYPE_TEXT) &&
3118 (real->typedata.text) && (real->typedata.text->source == rp))
3118 real->typedata.text->source = NULL; 3119 real->typedata.text->source = NULL;
3119 if ((real->typedata.text) && (real->typedata.text->text_source == rp)) 3120 if ((rp->type == EDJE_RP_TYPE_TEXT) &&
3121 (real->typedata.text) && (real->typedata.text->text_source == rp))
3120 real->typedata.text->text_source = NULL; 3122 real->typedata.text->text_source = NULL;
3121 3123
3122 if (real->part->clip_to_id == rp->part->id) 3124 if (real->part->clip_to_id == rp->part->id)
@@ -3336,7 +3338,8 @@ edje_edit_part_restack_below(Evas_Object *obj, const char* part)
3336 _edje_parts_id_switch(ed, rp, prev); 3338 _edje_parts_id_switch(ed, rp, prev);
3337 3339
3338 evas_object_stack_below(rp->object, prev->object); 3340 evas_object_stack_below(rp->object, prev->object);
3339 if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object)) 3341 if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
3342 (rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
3340 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object); 3343 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
3341 3344
3342 _edje_edit_flag_script_dirty(eed, EINA_TRUE); 3345 _edje_edit_flag_script_dirty(eed, EINA_TRUE);
@@ -3373,7 +3376,8 @@ edje_edit_part_restack_part_below(Evas_Object *obj, const char* part, const char
3373 } 3376 }
3374 3377
3375 evas_object_stack_below(rp->object, rp_below->object); 3378 evas_object_stack_below(rp->object, rp_below->object);
3376 if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object)) 3379 if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
3380 (rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
3377 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object); 3381 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
3378 3382
3379 _edje_edit_flag_script_dirty(eed, EINA_TRUE); 3383 _edje_edit_flag_script_dirty(eed, EINA_TRUE);
@@ -3408,7 +3412,8 @@ edje_edit_part_restack_above(Evas_Object *obj, const char* part)
3408 _edje_parts_id_switch(ed, rp, next); 3412 _edje_parts_id_switch(ed, rp, next);
3409 3413
3410 evas_object_stack_above(rp->object, next->object); 3414 evas_object_stack_above(rp->object, next->object);
3411 if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object)) 3415 if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
3416 (rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
3412 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object); 3417 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
3413 3418
3414 _edje_edit_flag_script_dirty(eed, EINA_TRUE); 3419 _edje_edit_flag_script_dirty(eed, EINA_TRUE);
@@ -3445,7 +3450,8 @@ edje_edit_part_restack_part_above(Evas_Object *obj, const char* part, const char
3445 } 3450 }
3446 3451
3447 evas_object_stack_above(rp->object, rp_above->object); 3452 evas_object_stack_above(rp->object, rp_above->object);
3448 if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object)) 3453 if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
3454 (rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
3449 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object); 3455 evas_object_stack_above(rp->typedata.swallow->swallowed_object, rp->object);
3450 3456
3451 _edje_edit_flag_script_dirty(eed, EINA_TRUE); 3457 _edje_edit_flag_script_dirty(eed, EINA_TRUE);
@@ -3535,7 +3541,8 @@ edje_edit_part_clip_to_set(Evas_Object *obj, const char *part, const char *clip_
3535 } 3541 }
3536 3542
3537 evas_object_clip_set(rp->object, ed->base->clipper); 3543 evas_object_clip_set(rp->object, ed->base->clipper);
3538 if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object)) 3544 if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
3545 (rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
3539 evas_object_clip_set(rp->typedata.swallow->swallowed_object, ed->base->clipper); 3546 evas_object_clip_set(rp->typedata.swallow->swallowed_object, ed->base->clipper);
3540 3547
3541 rp->part->clip_to_id = -1; 3548 rp->part->clip_to_id = -1;
@@ -3562,7 +3569,8 @@ edje_edit_part_clip_to_set(Evas_Object *obj, const char *part, const char *clip_
3562 evas_object_pass_events_set(clip->object, 1); 3569 evas_object_pass_events_set(clip->object, 1);
3563 evas_object_pointer_mode_set(clip->object, EVAS_OBJECT_POINTER_MODE_NOGRAB); 3570 evas_object_pointer_mode_set(clip->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
3564 evas_object_clip_set(rp->object, clip->object); 3571 evas_object_clip_set(rp->object, clip->object);
3565 if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object)) 3572 if ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
3573 (rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
3566 evas_object_clip_set(rp->typedata.swallow->swallowed_object, clip->object); 3574 evas_object_clip_set(rp->typedata.swallow->swallowed_object, clip->object);
3567 3575
3568 edje_object_calc_force(obj); 3576 edje_object_calc_force(obj);