Evas textblock: Fixed cursor sizes in rare situations, for example the text from...
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Aug 2010 15:49:43 +0000 (15:49 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Aug 2010 15:49:43 +0000 (15:49 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@51050 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index d3a4e3a..30099a6 100644 (file)
@@ -3132,10 +3132,9 @@ _find_layout_item_line_match(Evas_Object *obj, Evas_Object_Textblock_Node_Text *
 
                   itn = (Evas_Object_Textblock_Item *)(((Eina_Inlist *)it)->next);
                   p = (int)(it->source_pos + eina_unicode_strlen(it->text));
-                  /*FIXME: Bad, this sholud be > pos */
-                  if ((p >= pos) ||
+                  if ((p > pos) ||
                         ((p == pos) && (!lnn) &&
-                         ((!itn)  |
+                         ((!itn) ||
                           ((itn) && (itn->source_node != n)))))
                     {
                        *lnr = ln;
@@ -4786,8 +4785,7 @@ evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur)
        cur->node = it->source_node;
        index = eina_unicode_strlen(it->text) - 1;
         if (index < 0) index = 0;
-        if ((index >= 0) && (it->text[0] != 0))
-          GET_NEXT(it->text, index);
+        if (index >= 0) GET_NEXT(it->text, index);
        if (index >= 0) cur->pos += index;
      }
    else if (fi)