efl_ui_grid: add an error to grid
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Wed, 24 Apr 2019 17:12:15 +0000 (19:12 +0200)
committerWoochanlee <wc0917.lee@samsung.com>
Tue, 30 Apr 2019 01:03:03 +0000 (10:03 +0900)
grid only accepts grid items, not general widgets. If a wrong type is
passed in, a error should be printed.

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8704

src/lib/elementary/efl_ui_grid.c

index 8e0e0a3..6f7e506 100644 (file)
@@ -954,7 +954,11 @@ _grid_item_deleted(void *data, const Efl_Event *event)
 static Eina_Bool
 _grid_item_process(Eo *obj, Efl_Ui_Grid_Data *pd, EINA_UNUSED Efl_Ui_Grid_Item *it)
 {
-   EFL_UI_GRID_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
+   if (!efl_isa(it, EFL_UI_GRID_ITEM_CLASS))
+     {
+        ERR("Item must be of type EFL_UI_GRID_ITEM_CLASS");
+        return EINA_FALSE;
+     }
 
    if (eina_list_data_find(pd->items, it))
      {