Evas textblock: Fixed evas_textblock_cursor_paragraph_text_get to return markup.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 16 Aug 2010 09:40:01 +0000 (09:40 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 16 Aug 2010 09:40:01 +0000 (09:40 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@51181 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 9fbae88..fd64396 100644 (file)
@@ -6053,7 +6053,7 @@ evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Ev
 }
 
 /**
- * Return the text of the paragraph cur points to.
+ * Return the text of the paragraph cur points to - returns the text in markup..
  *
  * @param cur the cursor pointing to the paragraph.
  * @return the text on success, NULL otherwise.
@@ -6061,15 +6061,20 @@ evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Ev
 EAPI const char *
 evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur)
 {
+   Evas_Textblock_Cursor cur1, cur2;
    if (!cur) return NULL;
    if (!cur->node) return NULL;
-   /*FIXME-tom: strip replace chars */
    if (cur->node->utf8)
      {
         free(cur->node->utf8);
      }
-   cur->node->utf8 = evas_common_encoding_unicode_to_utf8(
-         eina_ustrbuf_string_get(cur->node->unicode), NULL);
+   cur1.obj = cur2.obj = cur->obj;
+   cur1.node = cur2.node = cur->node;
+   evas_textblock_cursor_paragraph_char_first(&cur1);
+   evas_textblock_cursor_paragraph_char_last(&cur2);
+
+   cur->node->utf8 = evas_textblock_cursor_range_text_get(&cur1, &cur2,
+         EVAS_TEXTBLOCK_TEXT_MARKUP);
    return cur->node->utf8;
 }