Edje: Return text defined in EDC in part_text_get

This function was returning only the text defined by part_text_set.
This is a behaviour change, as part_text_get() no longer returns NULL
if there is a string defined in EDC. But this now means that the actual
value displayed on screen can be retrieved by a simple API call.

@feature
This commit is contained in:
Jean-Philippe Andre 2016-04-25 15:41:27 +09:00
parent 97422856ce
commit 12146ddea6
2 changed files with 11 additions and 1 deletions

View File

@ -2278,7 +2278,17 @@ _edje_object_part_text_get(Eo *obj EINA_UNUSED, Edje *ed, const char *part)
{
if (rp->part->type == EDJE_PART_TYPE_TEXT)
{
return rp->typedata.text->text;
Edje_Part_Description_Text *desc;
if (rp->typedata.text->text)
return rp->typedata.text->text;
else
{
desc = (Edje_Part_Description_Text *) rp->chosen_description;
if (desc->text.text.translated)
return desc->text.text.translated;
else
return desc->text.text.str;
}
}
if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)
{

View File