From ca8a8b712c8f6693700d516e5695561b11df7540 Mon Sep 17 00:00:00 2001 From: Daniel Hirt Date: Sun, 4 Jun 2017 17:25:36 +0300 Subject: [PATCH] Elm layout: fix a few objects after move to efl_part Fixes elm_layout_text_set/get bugs that were introduced in 3eb649b180eb98f7be829de5aed7e8c7f1ceb35a. --- src/lib/elementary/elm_entry.c | 6 +++--- src/lib/elementary/elm_layout.c | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 16db1db..e5f9eec 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -3192,7 +3192,7 @@ _elm_entry_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, const char *e int len = 0; if (!entry) entry = ""; - if (part) + if (part && strcmp(part, "elm.text")) { if (!strcmp(part, "guide")) edje_object_part_text_set(sd->entry_edje, "elm.guide", entry); @@ -3244,7 +3244,7 @@ _elm_entry_text_get(Eo *obj, Elm_Entry_Data *sd, const char *item) if (item) { - if (!strcmp(item, "default")) goto proceed; + if (!strcmp(item, "default") || strcmp(item, "elm.text")) goto proceed; else if (!strcmp(item, "guide")) { return edje_object_part_text_get(sd->entry_edje, "elm.guide"); @@ -4147,7 +4147,7 @@ elm_entry_entry_get(const Evas_Object *obj) { ELM_ENTRY_CHECK(obj) NULL; const char *text = NULL; - text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text")); + text = efl_text_get(efl_part(obj, "elm.text")); return text; } diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c index 18e6f5a..79b88ac 100644 --- a/src/lib/elementary/elm_layout.c +++ b/src/lib/elementary/elm_layout.c @@ -2318,6 +2318,10 @@ elm_layout_table_clear(Elm_Layout *obj, const char *part, Eina_Bool clear) EAPI Eina_Bool elm_layout_text_set(Elm_Layout *obj, const char *part, const char *text) { + if (!part || (*part == '\0')) + { + part = "elm.text"; + } efl_text_set(efl_part(obj, part), text); return EINA_TRUE; } @@ -2325,6 +2329,10 @@ elm_layout_text_set(Elm_Layout *obj, const char *part, const char *text) EAPI const char * elm_layout_text_get(const Elm_Layout *obj, const char *part) { + if (!part || (*part == '\0')) + { + part = "elm.text"; + } return efl_text_get(efl_part(obj, part)); } -- 2.7.4