efm/widget robustness - handle cleared or invalid widgets

enlightenment-0.24
Carsten Haitzler 3 years ago
parent 4a69f273fa
commit b22831fb30
  1. 15
      src/bin/e_widget_label.c
  2. 15
      src/bin/e_widget_table.c

@ -50,27 +50,24 @@ e_widget_label_add(Evas *evas, const char *label)
E_API void
e_widget_label_text_set(Evas_Object *obj, const char *text)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_Widget_Data *wd = e_widget_data_get(obj);
if (!wd) return;
elm_object_text_set(wd->text, text);
}
static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_Widget_Data *wd = e_widget_data_get(obj);
free(wd);
if (!wd) return;
}
static void
_e_wid_disable_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_Widget_Data *wd = e_widget_data_get(obj);
if (!wd) return;
elm_object_disabled_set(wd->text, e_widget_disabled_get(obj));
}

@ -45,9 +45,8 @@ e_widget_table_object_append(Evas_Object *obj, Evas_Object *sobj, int col, int r
E_API void
e_widget_table_object_align_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h, double ax, double ay)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_Widget_Data *wd = e_widget_data_get(obj);
if (!wd) return;
if (fill_w) ax = -1;
if (fill_h) ay = -1;
@ -70,9 +69,8 @@ e_widget_table_object_repack(Evas_Object *obj EINA_UNUSED, Evas_Object *sobj, in
E_API void
e_widget_table_unpack(Evas_Object *obj, Evas_Object *sobj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_Widget_Data *wd = e_widget_data_get(obj);
if (!wd) return;
e_widget_sub_object_del(obj, sobj);
elm_table_unpack(wd->o_table, sobj);
}
@ -80,9 +78,8 @@ e_widget_table_unpack(Evas_Object *obj, Evas_Object *sobj)
static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
E_Widget_Data *wd = e_widget_data_get(obj);
if (!wd) return;
free(wd);
}

Loading…
Cancel
Save