summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2018-01-16 15:12:49 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2018-01-16 18:37:05 +0900
commita92186be6ab7ba6b8ba0b2bedeaec51dcb4a3898 (patch)
treec22e99af65360feb242ead4bccd12acee605d424 /src/lib/edje
parentf2b5b00ca204e8a0b8c4ab671f60088da4edfca3 (diff)
ecore/edje/elm: Fix a few WRN from calls to NULL
This fixes some of the warnings generated by calling functions on NULL objects. One of the main remaining points is to avoid unwanted warnings on non-existing parts. Ref T6326
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/edje_calc.c3
-rw-r--r--src/lib/edje/edje_smart.c16
-rw-r--r--src/lib/edje/edje_util.c6
3 files changed, 19 insertions, 6 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 64b95ed..2e18621 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -1083,7 +1083,8 @@ _edje_dragable_pos_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T x, FLOAT_T y)
1083 * value we would set foo to, because it would depend on the 1083 * value we would set foo to, because it would depend on the
1084 * size of the dragable... 1084 * size of the dragable...
1085 */ 1085 */
1086 evas_object_geometry_get(ep->object, &ex, &ey, NULL, NULL); 1086 if (ep->object)
1087 evas_object_geometry_get(ep->object, &ex, &ey, NULL, NULL);
1087 1088
1088 if (NEQ(ep->drag->x, x) || ep->drag->tmp.x) 1089 if (NEQ(ep->drag->x, x) || ep->drag->tmp.x)
1089 { 1090 {
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index ae038fb..6b4ed89 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -182,13 +182,21 @@ _efl_canvas_layout_efl_gfx_position_set(Eo *obj, Edje *ed, Eina_Position2D pos)
182 ep = ed->table_parts[i]; 182 ep = ed->table_parts[i];
183 if ((ep->type == EDJE_RP_TYPE_TEXT) && (ep->typedata.text)) 183 if ((ep->type == EDJE_RP_TYPE_TEXT) && (ep->typedata.text))
184 { 184 {
185 evas_object_move(ep->object, 185 if (ep->object)
186 ed->x + ep->x + ep->typedata.text->offset.x, 186 evas_object_move(ep->object,
187 ed->y + ep->y + ep->typedata.text->offset.y); 187 ed->x + ep->x + ep->typedata.text->offset.x,
188 ed->y + ep->y + ep->typedata.text->offset.y);
189 else if (ep->type != EFL_CANVAS_LAYOUT_PART_TYPE_NONE)
190 WRN("No object for part '%s' in group '%s'",
191 ep->part ? ep->part->name : "<invalid>", ed->group);
188 } 192 }
189 else 193 else
190 { 194 {
191 evas_object_move(ep->object, ed->x + ep->x, ed->y + ep->y); 195 if (ep->object)
196 evas_object_move(ep->object, ed->x + ep->x, ed->y + ep->y);
197 else if (ep->type != EFL_CANVAS_LAYOUT_PART_TYPE_NONE)
198 WRN("No object for part '%s' in group '%s'",
199 ep->part ? ep->part->name : "<invalid>", ed->group);
192 if ((ep->type == EDJE_RP_TYPE_SWALLOW) && 200 if ((ep->type == EDJE_RP_TYPE_SWALLOW) &&
193 (ep->typedata.swallow)) 201 (ep->typedata.swallow))
194 { 202 {
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index b5638ec..cfbccd6 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -3297,7 +3297,11 @@ _efl_canvas_layout_efl_part_part(Eo *obj, Edje *ed, const char *part)
3297 if ((!ed) || (!part)) return NULL; 3297 if ((!ed) || (!part)) return NULL;
3298 3298
3299 rp = _edje_real_part_recursive_get(&ed, part); 3299 rp = _edje_real_part_recursive_get(&ed, part);
3300 if (!rp) return NULL; 3300 if (EINA_UNLIKELY(!rp))
3301 {
3302 WRN("No such part '%s' in group '%s'.", part, ed->group);
3303 return NULL;
3304 }
3301 3305
3302 if (rp->part->type == EDJE_PART_TYPE_BOX) 3306 if (rp->part->type == EDJE_PART_TYPE_BOX)
3303 return _edje_box_internal_proxy_get(obj, ed, rp); 3307 return _edje_box_internal_proxy_get(obj, ed, rp);