evas: fix case when we were in the middle of a charactere.

SVN revision: 80811
This commit is contained in:
Cedric BAIL 2012-12-13 10:36:00 +00:00
parent 981b5f7d40
commit 2ade3fa902
3 changed files with 6 additions and 4 deletions

View File

@ -639,7 +639,8 @@ _layout_text_item_trim(Evas_Object_Protected_Data *obj, Evas_Object_Text *o, Eva
memset(&new_text_props, 0, sizeof (new_text_props));
evas_common_text_props_split(&ti->text_props, &new_text_props, idx);
while (!evas_common_text_props_split(&ti->text_props, &new_text_props, idx))
idx--;
if (want_start)
{
evas_common_text_props_content_unref(&new_text_props);

View File

@ -245,7 +245,7 @@ evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff)
/* Won't work in the middle of ligatures, assumes cutoff < len.
* Also won't work in the middle of indic words, should handle that in a
* smart way. */
EAPI void
EAPI Eina_Bool
evas_common_text_props_split(Evas_Text_Props *base,
Evas_Text_Props *ext, int _cutoff)
{
@ -262,7 +262,7 @@ evas_common_text_props_split(Evas_Text_Props *base,
else
{
ERR("Couldn't find the cutoff position. Is it inside a cluster?");
return;
return EINA_FALSE;
}
#else
cutoff = (size_t) _cutoff;
@ -299,6 +299,7 @@ evas_common_text_props_split(Evas_Text_Props *base,
base->text_len = (ext->text_offset - base->text_offset);
PROPS_CHANGE(base);
PROPS_CHANGE(ext);
return EINA_TRUE;
}
/* Won't work in the middle of ligatures */

View File

@ -95,7 +95,7 @@ evas_common_text_props_cluster_prev(const Evas_Text_Props *props, int pos);
EAPI int
evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff);
EAPI void
EAPI Eina_Bool
evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext,
int cutoff);
EAPI void