edje: return available text data in part_text_get without recalc when possible

Summary:
based on the codepaths taken when setting text to a part, a recalc should
only be necessary when returning markup from a textblock, and this is only
the case because the function returns a non-allocated string

in the case where the object is textblock and (legacy || not fetching markup),
the current text is guaranteed to be set on this pointer. the reason a
recalc is necessary for the markup case is because edje TEXTBLOCK parts only
set text to the internal textblock during a recalc, meaning that attempting
to fetch text on a just-set part will fail; this does not mean that the internal
textblock object doesn't exist, only that the text has not yet been set to it
Depends on D6422

Reviewers: herdsman, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6423
This commit is contained in:
Mike Blumenkrantz 2018-06-25 15:19:33 -04:00 committed by Chris Michael
parent 6839003510
commit 7bbf18a950
1 changed files with 8 additions and 4 deletions

View File

@ -2080,18 +2080,22 @@ _edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part,
{
const char *entry;
if (legacy)
{
entry = evas_object_textblock_text_markup_get(rp->object);
}
entry = rp->typedata.text->text;
else
{
if (get_markup)
{
#ifdef EDJE_CALC_CACHE
if (rp->invalidate)
#else
if (ed->dirty)
#endif
_edje_recalc_do(ed);
entry = efl_text_markup_get(rp->object);
}
else
{
entry = efl_text_get(rp->object);
entry = rp->typedata.text->text;
}
}