Enlightenment CVS committal Author : moom Project : e17 Module : libs/etk
Dir : e17/libs/etk/src/lib Modified Files: etk_textblock2.c Log Message: * [Textblock2] Fix some bugs with formatting =================================================================== RCS file: /cvs/e/e17/libs/etk/src/lib/etk_textblock2.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- etk_textblock2.c 10 Nov 2007 16:11:43 -0000 1.6 +++ etk_textblock2.c 10 Nov 2007 18:09:18 -0000 1.7 @@ -319,6 +319,14 @@ for (i = 0; markup_text[i] != '\0' && (length < 0 || i < length); i++) { + if (!text_start && !tag_start) + { + if (markup_text[i] == '<') + tag_start = &markup_text[i]; + else + text_start = &markup_text[i]; + } + if (text_start) { if (markup_text[i + 1] == '\0' || markup_text[i + 1] == '<' || (length >= 0 && (i + 1) >= length)) @@ -332,24 +340,25 @@ } else if (tag_start) { - if (markup_text[i] == '>') + if (markup_text[i + 1] == '\0' || markup_text[i] == '>' || (length >= 0 && (i + 1) >= length)) { tag_end = &markup_text[i]; etk_string_set_sized(string, tag_start, tag_end - tag_start + 1); - prev_node = iter->node; - node = etk_textblock2_node_add(iter); - etk_textblock2_node_format_set(node, prev_node->format); + if (iter->node->unicode_length > 0) + { + prev_node = iter->node; + node = etk_textblock2_node_add(iter); + etk_textblock2_node_format_set(node, prev_node->format); + } + else + node = iter->node; etk_textblock2_node_format_apply(node, etk_string_get(string)); tag_start = NULL; tag_end = NULL; } } - else if (markup_text[i] == '<') - tag_start = &markup_text[i]; - else - text_start = &markup_text[i]; } etk_object_destroy(ETK_OBJECT(string)); @@ -998,7 +1007,7 @@ if (!node || !format) return; - /* TODO! */ + } /************************** @@ -1854,6 +1863,14 @@ for (i = 0; text[i] != '\0' && (length < 0 || i < length); i++) { + if (!text_start && !escape_start) + { + if (text[i] == '&') + escape_start = &text[i]; + else + text_start = &text[i]; + } + if (text_start) { if (text[i + 1] == '\0' || text[i + 1] == '&' || (length >= 0 && (i + 1) >= length)) @@ -1888,10 +1905,6 @@ escape_end = NULL; } } - else if (text[i] == '&') - escape_start = &text[i]; - else - text_start = &text[i]; } } ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs