From b25df71d57a0e8426518137f42047d248f13322a Mon Sep 17 00:00:00 2001 From: Ryuan Choi Date: Sun, 29 Dec 2013 13:33:19 +0900 Subject: [PATCH] textblock: Simple refactoring for _markup_get_text_utf8_append to call eina_unicode_utf8_next_get directly Summary: evas_string_char_next_get is simple wrapper of eina_unicode_utf8_next_get with some check routines. But in _markup_get_text_utf8_append, these check routines look unnecessary. Reviewers: cedric, seoz, raster Reviewed By: raster CC: cedric Differential Revision: https://phab.enlightenment.org/D420 --- src/lib/evas/canvas/evas_object_textblock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 992c42baeb..00755b3dd1 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6335,7 +6335,7 @@ _markup_get_text_utf8_append(Eina_Strbuf *sbuf, const char *text) for (;;) { pos = pos2; - pos2 = evas_string_char_next_get(text, pos2, &ch); + ch = eina_unicode_utf8_next_get(text, &pos2); if ((ch <= 0) || (pos2 <= 0)) break; if (ch == _NEWLINE) @@ -6371,6 +6371,8 @@ _markup_get_text_append(Eina_Strbuf *txt, const Eina_Unicode *text) { char *base = eina_unicode_unicode_to_utf8(text, NULL); + if (!base) return; + _markup_get_text_utf8_append(txt, base); free(base);