Elm entry: Fixed a bug with entry_get with big texts.

Entry gradually loads big texts. This bug caused entry_get to return the
current text in the textblock, and not the text not yet loaded.

SVN revision: 61840
This commit is contained in:
Tom Hacohen 2011-07-28 08:18:37 +00:00
parent b1dde8fb29
commit e0364385f8
1 changed files with 22 additions and 1 deletions

View File

@ -1913,7 +1913,28 @@ _elm_entry_text_get(const Evas_Object *obj, const char *item)
ERR("text=NULL for edje %p, part 'elm.text'", wd->ent);
return NULL;
}
eina_stringshare_replace(&wd->text, text);
if (wd->append_text_len > 0)
{
char *tmpbuf;
size_t tlen;
tlen = strlen(text);
tmpbuf = malloc(tlen + wd->append_text_len + 1);
if (!tmpbuf)
{
ERR("Failed to allocate memory for entry's text %p", obj);
return NULL;
}
memcpy(tmpbuf, text, tlen);
memcpy(tmpbuf + tlen, wd->append_text_left, wd->append_text_len);
tmpbuf[tlen + wd->append_text_len] = '\0';
eina_stringshare_replace(&wd->text, tmpbuf);
free(tmpbuf);
}
else
{
eina_stringshare_replace(&wd->text, text);
}
return wd->text;
}