diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/e-searching-tokenizer.c | 10 |
2 files changed, 16 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index b274a5dfd5..459468ccbd 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-10-13 Jon Trowbridge <trow@ximian.com> + + * e-searching-tokenizer.c (search_info_compare): Bad hacker! + Don't implicitly assume that utf8 characters are one byte in size! + (Bug #9520) + (e_searching_tokenizer_begin): As long as I'm touching those code: + don't increase the size of search matches. I'll fix the colors + later. (part of bug #11589) + 2001-10-13 Dan Winship <danw@ximian.com> * mail-callbacks.c (create_msg_composer): Don't emit a gtk warning diff --git a/mail/e-searching-tokenizer.c b/mail/e-searching-tokenizer.c index 47266fc836..8888bc7c38 100644 --- a/mail/e-searching-tokenizer.c +++ b/mail/e-searching-tokenizer.c @@ -328,8 +328,14 @@ search_info_compare (SearchInfo *si, const gchar *token, gint *start_pos, gint * /* Check to see if the search string is entirely embedded within the token. */ s = find_whole (si, token, si->search); if (s) { + const gchar *pos = s; + i = g_utf8_strlen (si->search, -1); + while (i > 0) { + pos = g_utf8_next_char (pos); + --i; + } *start_pos = s - token; - *end_pos = *start_pos + g_utf8_strlen (si->search, -1); + *end_pos = pos - token; return MATCH_COMPLETE; } @@ -817,7 +823,6 @@ e_searching_tokenizer_begin (HTMLTokenizer *t, gchar *content_type) search_info_set_case_sensitivity (si, st->priv->case_sensitive_primary); search_info_set_match_color (si, "red"); - search_info_set_match_size_increase (si, 1); search_info_set_match_bold (si, TRUE); } else if (st->priv->str_secondary) { @@ -826,7 +831,6 @@ e_searching_tokenizer_begin (HTMLTokenizer *t, gchar *content_type) search_info_set_case_sensitivity (si, st->priv->case_sensitive_secondary); search_info_set_match_color (si, "purple"); - search_info_set_match_size_increase (si, 1); search_info_set_match_bold (si, TRUE); } else { |