Evas textblock: Fix and simplify _find_layout_item_line_match which is an helper function used in many parts of textblock.

SVN revision: 52295
This commit is contained in:
Tom Hacohen 2010-09-15 10:24:07 +00:00
parent 108bdeeadd
commit 8b6083ec26
1 changed files with 6 additions and 6 deletions

View File

@ -3026,20 +3026,20 @@ _find_layout_item_line_match(Evas_Object *obj, Evas_Object_Textblock_Node_Text *
{
if (it->source_node == n)
{
Evas_Object_Textblock_Item *itn;
int p;
itn = (Evas_Object_Textblock_Item *)(((Eina_Inlist *)it)->next);
p = (int)(it->source_pos + eina_unicode_strlen(it->text));
if ((p > pos) ||
((p == pos) && (!lnn) &&
((!itn) ||
((itn) && (itn->source_node != n)))))
if (((pos >= (int) it->source_pos) && (pos < p)))
{
*lnr = ln;
*itr = it;
return;
}
else if (p == pos)
{
*lnr = ln;
*itr = it;
}
}
}
}