Evas: Each paragraph has at least one layout item in order to mark it's existence.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Aug 2010 14:20:19 +0000 (14:20 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 12 Aug 2010 14:20:19 +0000 (14:20 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@51039 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index 5338da8..6c116e3 100644 (file)
@@ -2396,6 +2396,7 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
         else
           {
              int len;
+             int orig_off = off;
              len = eina_ustrbuf_length_get(n->unicode);
              if (off == 0) return;
              else if (off < 0) off = len - start;
@@ -2404,6 +2405,13 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
                {
                   start = 0;
                }
+             else if ((start == 0) && (off == 0) && (orig_off == -1))
+               {
+                  /* Special case that means that we need to add an empty
+                   * item */
+                  str = EINA_UNICODE_EMPTY_STRING;
+                  goto skip;
+               }
              else if ((start >= len) || (off > len))
                {
                   return;
@@ -2415,13 +2423,11 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
                {
                   alloc_str[off] = 0;
                }
-             tbase = str = alloc_str;
+             str = alloc_str;
           }
      }
-   else
-     {
-        tbase = str;
-     }
+skip:
+   tbase = str;
    //   printf("add: wrap: %i|%i, width: %i '%s'\n", fmt->wrap_word, fmt->wrap_char, c->w, str);
    new_line = 0;
    empty_item = 0;