From 956bdf15722bf53dfa6c689b3b4555aff92a188a Mon Sep 17 00:00:00 2001 From: tasn Date: Mon, 14 Feb 2011 10:09:27 +0000 Subject: [PATCH] Evas textblock: speeded things up by using the cached text_len instead of calling eina_unicode_strlen all the time. Also fixed an issue with size calculation. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@57009 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index a04b7e5..78c2da1 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -2500,12 +2500,12 @@ _layout_item_merge_and_free(Ctxt *c, { Eina_Unicode *tmp; size_t len1, len2; - item1->parent.w += item2->parent.w; - item1->parent.adv += item2->parent.adv; + _text_item_update_sizes(c, item1); + len1 = item1->parent.text_props.text_len; + len2 = item2->parent.text_props.text_len; evas_common_text_props_merge(&item1->parent.text_props, &item2->parent.text_props); - len1 = eina_unicode_strlen(item1->text); - len2 = eina_unicode_strlen(item2->text); + tmp = realloc(item1->text, (len1 + len2 + 1) * sizeof(Eina_Unicode)); eina_unicode_strcpy(tmp + len1, item2->text); item1->text = tmp; -- 2.7.4