Evas textblock: Fixed range_text_get, no works when selecting text from multiple...
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 19 Aug 2010 14:07:45 +0000 (14:07 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 19 Aug 2010 14:07:45 +0000 (14:07 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@51392 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 4270a40..5d7cda2 100644 (file)
@@ -6037,25 +6037,30 @@ evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Ev
            eina_unicode_strdup(eina_ustrbuf_string_get(tnode->unicode));
         if (tnode == cur2->node)
           {
-             fnode = _evas_textblock_node_text_get_first_format_between(n1,
+             fnode = _evas_textblock_node_text_get_first_format_between(tnode,
                    cur1->pos, cur2->pos);
           }
-        else
+        else if (tnode == cur1->node)
           {
-             fnode = _evas_textblock_node_text_get_first_format_between(n1,
+             fnode = _evas_textblock_node_text_get_first_format_between(tnode,
                    cur1->pos, -1);
           }
+        else
+          {
+             fnode = _evas_textblock_node_text_get_first_format_between(tnode,
+                   0, -1);
+          }
         /* Init the offset so the first one will count starting from cur1->pos
          * and not the previous format node */
         if ((tnode == cur1->node) && fnode)
           {
              off = _evas_textblock_node_format_pos_get(fnode) - cur1->pos - fnode->offset;
+             text += cur1->pos;
           }
         else
           {
              off = 0;
           }
-        text += cur1->pos;
         while (fnode && (fnode->text_node == tnode))
           {
              Eina_Unicode tmp_ch;