The _elm_util_mkup_to_text gives alloacated plain text.
This plain text should be freed.
Change-Id: I4fe6443a2be78a80b00e79925b9ac968e489df76
eo_do_super(eo_it, ELM_CTXPOPUP_ITEM_CLASS, accessible_name = (char *)elm_interface_atspi_accessible_name_get());
if (accessible_name) return accessible_name;
- return _elm_util_mkup_to_text(elm_object_item_text_get(item->list_item));
+ return _elm_widget_item_accessible_plain_name_get(eo_it,
+ elm_object_item_text_get(item->list_item));
}
//
eo_do_super(eo_it, ELM_MULTIBUTTONENTRY_ITEM_CLASS, ret = elm_interface_atspi_accessible_name_get());
if (ret) return ret;
ret = elm_object_part_text_get(VIEW(it), "elm.btn.text");
- return _elm_util_mkup_to_text(ret);
+ return _elm_widget_item_accessible_plain_name_get(eo_it, ret);
}
EOLIAN static Elm_Atspi_State_Set
if (nit->title_label) strncat(buf, " ", 1);
strncat(buf, nit->subtitle_label, sizeof(buf) - strlen(buf) - 2);
}
- eo_do(VIEW(it), elm_interface_atspi_accessible_name_set(_elm_util_mkup_to_text(buf)));
+ char *plain_text = _elm_util_mkup_to_text(buf);
+ eo_do(VIEW(it), elm_interface_atspi_accessible_name_set(plain_text));
+ free(plain_text);
elm_layout_sizing_eval(WIDGET(nit));
}
//item base layout
VIEW(it) = elm_layout_add(obj);
eo_do(VIEW(it), elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_PAGE_TAB));
- eo_do(VIEW(it), elm_interface_atspi_accessible_name_set(_elm_util_mkup_to_text((char*)title_label)));
+ char *plain_text = _elm_util_mkup_to_text((char*)title_label);
+ eo_do(VIEW(it), elm_interface_atspi_accessible_name_set(plain_text));
+ free(plain_text);
+
evas_object_smart_member_add(VIEW(it), obj);
if (!elm_widget_sub_object_add(obj, VIEW(it)))
{
char *text = NULL;
if (data) text = _elm_util_mkup_to_text((char*)data);
- if (text) return strdup(text);
+ if (text) return text;
return NULL;
}
else if (elm_object_part_text_get(obj, "elm.text"))
utf8_text = _elm_util_mkup_to_text(elm_object_part_text_get(obj, "elm.text"));
- if (utf8_text) eina_strbuf_append_printf(buf, ", %s", utf8_text);
+ if (utf8_text)
+ {
+ eina_strbuf_append_printf(buf, ", %s", utf8_text);
+ free(utf8_text);
+ }
}
accessible_name = eina_strbuf_string_steal(buf);
EOLIAN static const char*
_elm_entry_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Entry_Data *sd)
{
- char *name = NULL;
- eo_do_super(obj, ELM_ENTRY_CLASS, name = (char *)elm_interface_atspi_accessible_name_get());
+ const char *name = NULL;
+ eo_do_super(obj, ELM_ENTRY_CLASS, name = elm_interface_atspi_accessible_name_get());
if (name && strncmp("", name, 1)) return name;
if (sd->password) return NULL;
- name = _elm_util_mkup_to_text(elm_entry_entry_get(obj));
+ name = _elm_widget_accessible_plain_name_get(obj, elm_entry_entry_get(obj));
if (name && strncmp("", name, 1)) return name;
const char *ret = edje_object_part_text_get(sd->entry_edje, "elm.guide");
- return _elm_util_mkup_to_text(ret);
+ return _elm_widget_accessible_plain_name_get(obj, ret);
}
//TIZEN ONLY (20160609): Added atspi action interface in entry
}
EOLIAN static const char*
-_elm_index_item_elm_interface_atspi_accessible_name_get(Eo *eo_it EINA_UNUSED, Elm_Index_Item_Data *data)
+_elm_index_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_Index_Item_Data *data)
{
- return _elm_util_mkup_to_text(data->letter);
+ return _elm_widget_item_accessible_plain_name_get(eo_it, data->letter);
}
EOLIAN static const Elm_Atspi_Action*
}
EOLIAN static const char*
-_elm_list_item_elm_interface_atspi_accessible_name_get(Eo *eo_it EINA_UNUSED, Elm_List_Item_Data *data)
+_elm_list_item_elm_interface_atspi_accessible_name_get(Eo *eo_it, Elm_List_Item_Data *data)
{
- return _elm_util_mkup_to_text(data->label);
+ return _elm_widget_item_accessible_plain_name_get(eo_it, data->label);
}
EOLIAN static Eina_List*
ret = elm_layout_text_get(obj, "elm.text");
}
//
- return _elm_util_mkup_to_text(ret);
+ return _elm_widget_accessible_plain_name_get(obj, ret);
}
// A11Y Accessibility - END
const char *ret;
eo_do_super(eo_item, ELM_TOOLBAR_ITEM_CLASS, ret = elm_interface_atspi_accessible_name_get());
if (ret) return ret;
- return _elm_util_mkup_to_text(item->label);
+ return _elm_widget_item_accessible_plain_name_get(eo_item, item->label);
}
EOLIAN static Elm_Atspi_State_Set
return EINA_TRUE;
}
+const char*
+_elm_widget_accessible_plain_name_get(Evas_Object *obj, const char* name)
+{
+ char *accessible_plain_name;
+
+ API_ENTRY return NULL;
+
+ accessible_plain_name = _elm_util_mkup_to_text(name);
+ eina_stringshare_del(sd->accessible_name);
+ sd->accessible_name = eina_stringshare_add(accessible_plain_name);
+ free(accessible_plain_name);
+ return sd->accessible_name;
+}
+
+const char*
+_elm_widget_item_accessible_plain_name_get(Elm_Object_Item *item, const char* name)
+{
+ char *accessible_plain_name;
+
+ Elm_Widget_Item_Data *id = eo_data_scope_get(item, ELM_WIDGET_ITEM_CLASS);
+ if (!id) return NULL;
+
+ accessible_plain_name = _elm_util_mkup_to_text(name);
+ eina_stringshare_del(id->accessible_name);
+ id->accessible_name = eina_stringshare_add(accessible_plain_name);
+ free(accessible_plain_name);
+ return id->accessible_name;
+}
+
//TIZEN_ONLY(20161107): enhance elm_atspi_accessible_can_highlight_set to set can_hihglight property to its children
EAPI Eina_Bool
_elm_widget_item_highlightable(Elm_Object_Item *item)
//
EOLIAN static const char*
-_elm_widget_elm_interface_atspi_accessible_name_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd)
+_elm_widget_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Widget_Smart_Data *_pd)
{
- char *accessible_name;
//TIZEN_ONLY(20190922): add name callback, description callback.
const char *ret = NULL;
eo_do_super(obj, ELM_WIDGET_CLASS, ret = elm_interface_atspi_accessible_name_get());
ret = elm_object_text_get(obj);
if (!ret) return NULL;
- accessible_name = _elm_util_mkup_to_text(ret);
- eina_stringshare_del(_pd->accessible_name);
- _pd->accessible_name = eina_stringshare_add(accessible_name);
- free(accessible_name);
- return _pd->accessible_name;
+ return _elm_widget_accessible_plain_name_get(obj, ret);
}
//TIZEN_ONLY(20161111) add widget/widget_item description get/set
EOLIAN void
EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *output);
EAPI Eina_Bool _elm_widget_onscreen_is(Evas_Object *widget);
EAPI Eina_Bool _elm_widget_item_onscreen_is(Elm_Object_Item *item);
+const char* _elm_widget_accessible_plain_name_get(Evas_Object *obj, const char* name);
+const char* _elm_widget_item_accessible_plain_name_get(Elm_Object_Item *item, const char* name);
//TIZEN_ONLY(20161107): enhance elm_atspi_accessible_can_highlight_set to set can_hihglight property to its children
EAPI Eina_Bool _elm_widget_highlightable(Evas_Object *widget);
EAPI Eina_Bool _elm_widget_item_highlightable(Elm_Object_Item *item);
eo_do_super(obj, ELM_WIN_CLASS, ret = elm_interface_atspi_accessible_name_get());
if (ret) return ret;
- return _elm_util_mkup_to_text(elm_win_title_get(obj));
+ return _elm_widget_accessible_plain_name_get(obj, elm_win_title_get(obj));
}
#include "elm_win.eo.c"
return icon_name;
}
else
- return _elm_util_mkup_to_text(item->label);
+ return _elm_widget_item_accessible_plain_name_get(eo_it, item->label);
}
//