From 5d3fc4a03e01e96ea567df15ea0429a8a68d399a Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 16 Aug 2010 08:36:08 +0000 Subject: [PATCH] Evas textblock: Use the unicode object replacement char, not the regular replacement char. Drop the object replacement char if passed as text. SVN revision: 51168 --- .../src/lib/canvas/evas_object_textblock.c | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index a252f95369..3ef19f16d0 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c @@ -115,8 +115,8 @@ * There are two types of format nodes, visible and invisible. They are the same * in every way, except for the representation in the text node. While invisible * format nodes have no representation in the text node, the visible ones do. - * The Uniceode replacement character (0xFFFD) is inserted to every place a - * visible format node points to. This makes it very easy to treat visible + * The Uniceode object replacement character (0xFFFC) is inserted to every place + * a visible format node points to. This makes it very easy to treat visible * formats as items in the text, both for BiDi purposes and cursor handling * purposes. * Here are a few example visible an invisible formats: @@ -137,7 +137,7 @@ static const char o_type[] = "textblock"; /* The char to be inserted instead of visible formats */ -#define EVAS_TEXTBLOCK_REPLACEMENT_CHAR 0xFFFD +#define EVAS_TEXTBLOCK_REPLACEMENT_CHAR 0xFFFC /* private struct for textblock object internal data */ /** @@ -3712,7 +3712,7 @@ _prepend_escaped_char(Evas_Textblock_Cursor *cur, const char *s, /** * Sets the tetxblock's text to the markup text. * - * @note assumes text does not include the unicode replacement char (0xFFFD) + * @note assumes text does not include the unicode object replacement char (0xFFFC) * * @param obj the textblock object. * @param text the markup text to use. @@ -3753,7 +3753,7 @@ evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) /** * Prepends markup to the cursor cur. * - * @note assumes text does not include the unicode replacement char (0xFFFD) + * @note assumes text does not include the unicode object replacement char (0xFFFC) * * @param cur the cursor to prepend to. * @param text the markup text to prepend. @@ -3883,6 +3883,16 @@ evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char s = p + 1; } } + /* Unicode object replcament char */ + else if (!strncmp("\xEF\xBF\xBC", p, 3)) + { + /*FIXME: currently just remove them, maybe do something + * fancier in the future, atm it breaks if this char + * is inside <> */ + _prepend_text_run(o, s, p); + p += 2; /* it's also advanced later in this loop */ + s = NULL; + } p++; } }