From eadf313702f81f05d39ba6c47385b8d8420a1330 Mon Sep 17 00:00:00 2001 From: Daniel Hirt Date: Mon, 2 Oct 2017 11:03:37 +0300 Subject: [PATCH] Canvas layout: fix Efl.text (non-legacy) TEXT parts Current implementation should also support TEXT parts (like button) with usage of efl_text_set. Follow-up to 0061a4bb349e6c8e122913791bf83f7f40b0cede. --- src/lib/edje/edje_util.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index db0a393..8db4ffd 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -1861,25 +1861,19 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par else if (text) { - if (legacy) + if (legacy || (rp->part->type == EDJE_PART_TYPE_TEXT) || set_markup) { rp->typedata.text->text = eina_stringshare_add(text); } - else if (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) + else // !legacy && (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK) + // && !set_markup { - if (set_markup) - { - rp->typedata.text->text = eina_stringshare_add(text); - } - else - { - char *mkup; - mkup = efl_text_markup_util_text_to_markup( - EFL_TEXT_MARKUP_UTIL_CLASS, - text); - rp->typedata.text->text = eina_stringshare_add(mkup); - free(mkup); - } + char *mkup; + mkup = efl_text_markup_util_text_to_markup( + EFL_TEXT_MARKUP_UTIL_CLASS, + text); + rp->typedata.text->text = eina_stringshare_add(mkup); + free(mkup); } } ed->dirty = EINA_TRUE; -- 2.7.4