Evas textblock: Fixed the mixed usage of a replacement char (e.g * on password textblocks) with formats.

SVN revision: 52485
This commit is contained in:
Tom Hacohen 2010-09-20 10:06:01 +00:00
parent e8c10dbce7
commit 1f8553de01
1 changed files with 24 additions and 25 deletions

View File

@ -2294,23 +2294,6 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
/* FIXME: explain the algorithm. */
if (n)
{
if ((repch) && (eina_ustrbuf_length_get(n->unicode)))
{
int i, len, ind;
Eina_Unicode *ptr;
Eina_Unicode urepch;
len = eina_ustrbuf_length_get(n->unicode);
str = alloca((len + 1) * sizeof(Eina_Unicode));
tbase = str;
ind = 0;
urepch = evas_common_encoding_utf8_get_next(repch, &ind);
for (i = 0, ptr = (Eina_Unicode *)tbase; i < len; ptr++, i++)
*ptr = urepch;
*ptr = 0;
}
else
{
int len;
int orig_off = off;
@ -2329,10 +2312,26 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
str = EINA_UNICODE_EMPTY_STRING;
goto skip;
}
else if ((start >= len) || (off > len))
else if ((start >= len) || (start + off > len))
{
return;
}
if ((repch) && (eina_ustrbuf_length_get(n->unicode)))
{
int i, ind;
Eina_Unicode *ptr;
Eina_Unicode urepch;
str = alloca((off + 1) * sizeof(Eina_Unicode));
tbase = str;
ind = 0;
urepch = evas_common_encoding_utf8_get_next(repch, &ind);
for (i = 0, ptr = (Eina_Unicode *)tbase; i < off; ptr++, i++)
*ptr = urepch;
*ptr = 0;
}
else
{
str = eina_ustrbuf_string_get(n->unicode);
alloc_str = eina_unicode_strdup(str + start);