forked from enlightenment/efl
Evas language utils: fixed evas_common_language_script_end_of_run_get and adjusted text and textblock object to use it.
SVN revision: 56478
This commit is contained in:
parent
ec59409dea
commit
3185db9667
|
@ -643,7 +643,7 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico
|
||||||
cutoff = evas_common_language_script_end_of_run_get(
|
cutoff = evas_common_language_script_end_of_run_get(
|
||||||
text,
|
text,
|
||||||
o->bidi_par_props,
|
o->bidi_par_props,
|
||||||
pos, len);
|
pos, len - pos);
|
||||||
if (cutoff > 0)
|
if (cutoff > 0)
|
||||||
{
|
{
|
||||||
#ifdef BIDI_SUPPORT
|
#ifdef BIDI_SUPPORT
|
||||||
|
|
|
@ -2589,14 +2589,14 @@ skip:
|
||||||
while (str && *str)
|
while (str && *str)
|
||||||
{
|
{
|
||||||
/* if this is the first line item and it starts with spaces - remove them */
|
/* if this is the first line item and it starts with spaces - remove them */
|
||||||
int tmp_len = 0;
|
int tmp_len;
|
||||||
wrap = 0;
|
wrap = 0;
|
||||||
white_stripped = 0;
|
white_stripped = 0;
|
||||||
|
|
||||||
ti = _layout_text_item_new(c, fmt, str);
|
ti = _layout_text_item_new(c, fmt, str);
|
||||||
ti->parent.text_node = n;
|
ti->parent.text_node = n;
|
||||||
ti->parent.text_pos = start + str - tbase;
|
ti->parent.text_pos = start + str - tbase;
|
||||||
tmp_len = eina_unicode_strlen(ti->text);
|
tmp_len = off - (str - tbase);
|
||||||
if (ti->parent.text_node)
|
if (ti->parent.text_node)
|
||||||
{
|
{
|
||||||
int tmp_cut;
|
int tmp_cut;
|
||||||
|
|
|
@ -59,7 +59,7 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str,
|
||||||
{
|
{
|
||||||
Evas_Script_Type first = EVAS_SCRIPT_UNKNOWN;
|
Evas_Script_Type first = EVAS_SCRIPT_UNKNOWN;
|
||||||
int i;
|
int i;
|
||||||
for (i = start, str += start ; (i < len) ; i++, str++)
|
for (i = 0 ; i < len ; i++, str++)
|
||||||
{
|
{
|
||||||
Evas_Script_Type tmp;
|
Evas_Script_Type tmp;
|
||||||
tmp = _get_script(*str);
|
tmp = _get_script(*str);
|
||||||
|
@ -75,11 +75,11 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i = i - start;
|
|
||||||
#ifdef BIDI_SUPPORT
|
#ifdef BIDI_SUPPORT
|
||||||
{
|
{
|
||||||
int bidi_end;
|
int bidi_end;
|
||||||
bidi_end = evas_bidi_end_of_run_get(bidi_props, start, len);
|
bidi_end = evas_bidi_end_of_run_get(bidi_props, start,
|
||||||
|
start + len);
|
||||||
if (bidi_end > 0)
|
if (bidi_end > 0)
|
||||||
{
|
{
|
||||||
i = (i < bidi_end) ? i : bidi_end;
|
i = (i < bidi_end) ? i : bidi_end;
|
||||||
|
@ -94,7 +94,7 @@ evas_common_language_script_end_of_run_get(const Eina_Unicode *str,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef BIDI_SUPPORT
|
#ifdef BIDI_SUPPORT
|
||||||
return evas_bidi_end_of_run_get(bidi_props, start, len);
|
return evas_bidi_end_of_run_get(bidi_props, start, start + len);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue