forked from enlightenment/efl
edje: call recalc in part_text_get if there is no available text data
Summary:
If edje_text_get is called before any edje_text_set function call, it return
null, because rp->typedata.text->text is only set by edje_text_set function.
If there is no available text data, find it from rp(edc).
ref 7bbf18a950
Test Plan: make check
Reviewers: zmike, id213sin, herdsman
Reviewed By: id213sin
Subscribers: Hermet, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6961
This commit is contained in:
parent
cd547c5a07
commit
9fc687a8c3
|
@ -2080,13 +2080,28 @@ _edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part,
|
|||
{
|
||||
const char *entry;
|
||||
if (legacy)
|
||||
entry = rp->typedata.text->text;
|
||||
{
|
||||
if (rp->typedata.text->text)
|
||||
{
|
||||
entry = rp->typedata.text->text;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
if (rp->invalidate || ed->all_part_change)
|
||||
#else
|
||||
if (ed->dirty)
|
||||
#endif
|
||||
_edje_recalc_do(ed);
|
||||
entry = evas_object_textblock_text_markup_get(rp->object);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (get_markup)
|
||||
{
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
if (rp->invalidate)
|
||||
if (rp->invalidate || ed->all_part_change)
|
||||
#else
|
||||
if (ed->dirty)
|
||||
#endif
|
||||
|
|
|
@ -11,6 +11,7 @@ collections {
|
|||
description { state: "default" 0.0;
|
||||
min: 300 300;
|
||||
text {
|
||||
text: "Bye";
|
||||
style: "tb_style";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,8 @@ EFL_START_TEST(edje_test_textblock)
|
|||
|
||||
obj = edje_object_add(evas);
|
||||
fail_unless(edje_object_file_set(obj, test_layout_get("test_textblock.edj"), "test_textblock"));
|
||||
txt = edje_object_part_text_get(obj, "text");
|
||||
fail_if(!txt || strcmp(txt, "Bye"));
|
||||
edje_object_part_text_set(obj, "text", buf);
|
||||
txt = edje_object_part_text_get(obj, "text");
|
||||
fail_if(!txt || strcmp(txt, buf));
|
||||
|
|
Loading…
Reference in New Issue