evas_object_textblock: Fix binary search fail.
authorWoochanlee <wc0917.lee@samsung.com>
Thu, 2 May 2019 14:34:04 +0000 (14:34 +0000)
committerHermet Park <hermetpark@gmail.com>
Wed, 8 May 2019 04:30:08 +0000 (13:30 +0900)
D8610 Makes API Testcase fault.

"&lt" is never searching.

@fix

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8803

src/lib/evas/canvas/evas_object_textblock.c
src/tests/evas/evas_test_textblock.c

index 3848cf1..1e345a8 100644 (file)
@@ -8457,6 +8457,8 @@ _markup_get_text_utf8_append(Eina_Strbuf *sbuf, const char *text)
            eina_strbuf_append(sbuf, "&amp;");
         else if (ch == '"')
            eina_strbuf_append(sbuf, "&quot;");
+        else if (ch == '\'')
+           eina_strbuf_append(sbuf, "&apos;");
         else if (ch == _PARAGRAPH_SEPARATOR)
            eina_strbuf_append(sbuf, "<ps/>");
         else if (ch == _REPLACEMENT_CHAR)
index b82e7e4..dc3f22d 100644 (file)
@@ -3241,6 +3241,13 @@ EFL_START_TEST(evas_textblock_text_getters)
         fail_if(strcmp(tmp2, "aa"));
         free(tmp2);
         free(tmp);
+
+        tmp = evas_textblock_text_markup_to_utf8(NULL, "&lt;align=center&gt;hello&lt;/align&gt;&amp;gt;&quot;&apos;");
+        fail_if(strcmp(tmp, "<align=center>hello</align>&gt;\"\'"));
+        tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp);
+        fail_if(strcmp(tmp2, "&lt;align=center&gt;hello&lt;/align&gt;&amp;gt;&quot;&apos;"));
+        free(tmp2);
+        free(tmp);
      }
 
    /* complex markup set/get */