From fe6983026171a54145ac6fab94b98951ad2edf8a Mon Sep 17 00:00:00 2001 From: Daniel Hirt Date: Sun, 10 Jul 2016 11:44:22 +0000 Subject: [PATCH] Ui text: cleanup some port leftovers --- src/lib/elementary/efl_ui_text.c | 148 ++++----------------------------------- 1 file changed, 12 insertions(+), 136 deletions(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 2ef2c4f..ec807d9 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -323,24 +323,7 @@ _file_load(const char *file) static char * _plain_load(const char *file) { -#if 0 - char *text; - - text = _file_load(file); - if (text) - { - char *text2; - - text2 = efl_ui_text_utf8_to_markup(text); - free(text); - return text2; - } - - return NULL; -#else - (void) file; - return NULL; -#endif + return _file_load(file); } static Eina_Bool @@ -358,37 +341,32 @@ _load_do(Evas_Object *obj) switch (sd->format) { + /* Only available format */ case ELM_TEXT_FORMAT_PLAIN_UTF8: - text = _plain_load(sd->file); - break; - - case ELM_TEXT_FORMAT_MARKUP_UTF8: - text = _file_load(sd->file); - break; + text = _plain_load(sd->file); + break; default: - text = NULL; - break; + text = NULL; + break; } if (text) { - elm_object_text_set(obj, text); + efl_text_set(obj, text); free(text); - return EINA_TRUE; } else { - elm_object_text_set(obj, ""); - + efl_text_set(obj, ""); return EINA_FALSE; } } static void -_utf8_markup_save(const char *file, - const char *text) +_text_save(const char *file, + const char *text) { FILE *f; @@ -411,25 +389,6 @@ _utf8_markup_save(const char *file, } static void -_utf8_plain_save(const char *file, - const char *text) -{ -#if 0 - char *text2; - - text2 = efl_ui_text_markup_to_utf8(text); - if (!text2) - return; - - _utf8_markup_save(file, text2); - free(text2); -#else - (void) file; - (void) text; -#endif -} - -static void _save_do(Evas_Object *obj) { EFL_UI_TEXT_DATA_GET(obj, sd); @@ -437,14 +396,12 @@ _save_do(Evas_Object *obj) if (!sd->file) return; switch (sd->format) { + /* Only supported format */ case ELM_TEXT_FORMAT_PLAIN_UTF8: - _utf8_plain_save(sd->file, elm_object_text_get(obj)); + _text_save(sd->file, efl_text_get(obj)); break; case ELM_TEXT_FORMAT_MARKUP_UTF8: - _utf8_markup_save(sd->file, elm_object_text_get(obj)); - break; - default: break; } @@ -2690,87 +2647,6 @@ _text_append_idler(void *data) } } -#if 0 -static void -_chars_add_till_limit(Evas_Object *obj, - char **text, - int can_add, - Length_Unit unit) -{ - int i = 0, current_len = 0; - char *new_text; - - if (!*text) return; - if (unit >= LENGTH_UNIT_LAST) return; - if (strstr(*text, "