From: Enlightenment S. <no-...@en...> - 2011-04-12 07:27:08
|
Log: Evas textblock: *_markup_prepend should use the passed cursor. This fixes a bug that caused evas_object_textblock_text_markup_prepend to use the object's cursor, instead of the passed cursor when prepending text. Backport from 1.1. Author: tasn Date: 2011-04-12 00:27:01 -0700 (Tue, 12 Apr 2011) New Revision: 58581 Trac: http://trac.enlightenment.org/e/changeset/58581 Modified: branches/evas-1.0/ChangeLog branches/evas-1.0/src/lib/canvas/evas_object_textblock.c Modified: branches/evas-1.0/ChangeLog =================================================================== --- branches/evas-1.0/ChangeLog 2011-04-12 07:13:33 UTC (rev 58580) +++ branches/evas-1.0/ChangeLog 2011-04-12 07:27:01 UTC (rev 58581) @@ -21,3 +21,9 @@ 2011-04-06 Cedric Bail * Backport all clip fix (should improve map and textblock usage). + +2011-04-12 Tom Hacohen (TAsn) + + * Backported a fix for evas_object_textblock_text_markup_prepend using + the wrong cursor. + Modified: branches/evas-1.0/src/lib/canvas/evas_object_textblock.c =================================================================== --- branches/evas-1.0/src/lib/canvas/evas_object_textblock.c 2011-04-12 07:13:33 UTC (rev 58580) +++ branches/evas-1.0/src/lib/canvas/evas_object_textblock.c 2011-04-12 07:27:01 UTC (rev 58581) @@ -902,12 +902,12 @@ * @internal * Appends the text between s and p to the main cursor of the object. * - * @param o The textblock to append to. + * @param cur the cursor to append to. * @param[in] s start of the string * @param[in] p end of the string */ static void __UNUSED__ -_append_text_run(Evas_Object_Textblock *o, const char *s, const char *p) +_append_text_run(Evas_Textblock_Cursor *cur, const char *s, const char *p) { if ((s) && (p > s)) { @@ -917,7 +917,7 @@ strncpy(ts, s, p - s); ts[p - s] = 0; ts = _clean_white(0, 0, ts); - evas_textblock_cursor_text_append(o->cursor, ts); + evas_textblock_cursor_text_append(cur, ts); free(ts); } } @@ -926,12 +926,12 @@ * @internal * Prepends the text between s and p to the main cursor of the object. * - * @param o The textblock to prepend to. + * @param cur the cursor to prepend to. * @param[in] s start of the string * @param[in] p end of the string */ static void -_prepend_text_run(Evas_Object_Textblock *o, const char *s, const char *p) +_prepend_text_run(Evas_Textblock_Cursor *cur, const char *s, const char *p) { if ((s) && (p > s)) { @@ -941,7 +941,7 @@ strncpy(ts, s, p - s); ts[p - s] = 0; ts = _clean_white(0, 0, ts); - evas_textblock_cursor_text_prepend(o->cursor, ts); + evas_textblock_cursor_text_prepend(cur, ts); free(ts); } } @@ -3672,7 +3672,7 @@ match = _style_match_tag(o->style, ttag, ttag_len, &replace_len); if (match) { - evas_textblock_cursor_format_prepend(o->cursor, match); + evas_textblock_cursor_format_prepend(cur, match); } else { @@ -3691,7 +3691,7 @@ strcpy(ttag2, "+ "); strcat(ttag2, ttag); } - evas_textblock_cursor_format_prepend(o->cursor, ttag2); + evas_textblock_cursor_format_prepend(cur, ttag2); free(ttag2); } } @@ -3701,12 +3701,12 @@ } else if (esc_end) { - _prepend_escaped_char(o->cursor, esc_start, esc_end); + _prepend_escaped_char(cur, esc_start, esc_end); esc_start = esc_end = NULL; } else if (*p == 0) { - _prepend_text_run(o, s, p); + _prepend_text_run(cur, s, p); s = NULL; } if (*p == 0) @@ -3720,7 +3720,7 @@ * the start of the tag */ tag_start = p; tag_end = NULL; - _prepend_text_run(o, s, p); + _prepend_text_run(cur, s, p); s = NULL; } } @@ -3740,7 +3740,7 @@ * the start of the escape sequence */ esc_start = p; esc_end = NULL; - _prepend_text_run(o, s, p); + _prepend_text_run(cur, s, p); s = NULL; } } @@ -3758,7 +3758,7 @@ /*FIXME: currently just remove them, maybe do something * fancier in the future, atm it breaks if this char * is inside <> */ - _prepend_text_run(o, s, p); + _prepend_text_run(cur, s, p); p += 2; /* it's also advanced later in this loop need +3 * in total*/ s = p + 1; /* One after the end of the replacement char */ |