forked from enlightenment/efl
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
This commit is contained in:
parent
011fb2d10a
commit
b25df71d57
|
@ -6335,7 +6335,7 @@ _markup_get_text_utf8_append(Eina_Strbuf *sbuf, const char *text)
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
pos = pos2;
|
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 <= 0) || (pos2 <= 0)) break;
|
||||||
|
|
||||||
if (ch == _NEWLINE)
|
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);
|
char *base = eina_unicode_unicode_to_utf8(text, NULL);
|
||||||
|
|
||||||
|
if (!base) return;
|
||||||
|
|
||||||
_markup_get_text_utf8_append(txt, base);
|
_markup_get_text_utf8_append(txt, base);
|
||||||
|
|
||||||
free(base);
|
free(base);
|
||||||
|
|
Loading…
Reference in New Issue