forked from enlightenment/efl
evas: fix case when we were in the middle of a charactere.
SVN revision: 80811
This commit is contained in:
parent
981b5f7d40
commit
2ade3fa902
|
@ -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));
|
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)
|
if (want_start)
|
||||||
{
|
{
|
||||||
evas_common_text_props_content_unref(&new_text_props);
|
evas_common_text_props_content_unref(&new_text_props);
|
||||||
|
|
|
@ -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.
|
/* 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
|
* Also won't work in the middle of indic words, should handle that in a
|
||||||
* smart way. */
|
* smart way. */
|
||||||
EAPI void
|
EAPI Eina_Bool
|
||||||
evas_common_text_props_split(Evas_Text_Props *base,
|
evas_common_text_props_split(Evas_Text_Props *base,
|
||||||
Evas_Text_Props *ext, int _cutoff)
|
Evas_Text_Props *ext, int _cutoff)
|
||||||
{
|
{
|
||||||
|
@ -262,7 +262,7 @@ evas_common_text_props_split(Evas_Text_Props *base,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ERR("Couldn't find the cutoff position. Is it inside a cluster?");
|
ERR("Couldn't find the cutoff position. Is it inside a cluster?");
|
||||||
return;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
cutoff = (size_t) _cutoff;
|
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);
|
base->text_len = (ext->text_offset - base->text_offset);
|
||||||
PROPS_CHANGE(base);
|
PROPS_CHANGE(base);
|
||||||
PROPS_CHANGE(ext);
|
PROPS_CHANGE(ext);
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Won't work in the middle of ligatures */
|
/* Won't work in the middle of ligatures */
|
||||||
|
|
|
@ -95,7 +95,7 @@ evas_common_text_props_cluster_prev(const Evas_Text_Props *props, int pos);
|
||||||
EAPI int
|
EAPI int
|
||||||
evas_common_text_props_index_find(const Evas_Text_Props *props, int _cutoff);
|
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,
|
evas_common_text_props_split(Evas_Text_Props *base, Evas_Text_Props *ext,
|
||||||
int cutoff);
|
int cutoff);
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
Loading…
Reference in New Issue