aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-searching-tokenizer.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-14 12:17:24 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-14 12:17:24 +0800
commitb407e779ceabe146aad777352a2e6af5f275c3c8 (patch)
tree4ec0fa7ac74e873d068d21e3d6eb0863c34ca6af /mail/e-searching-tokenizer.c
parenta28d0468805da949037d3a64c0ebfda21be77a56 (diff)
downloadgsoc2013-evolution-b407e779ceabe146aad777352a2e6af5f275c3c8.tar.gz
gsoc2013-evolution-b407e779ceabe146aad777352a2e6af5f275c3c8.tar.zst
gsoc2013-evolution-b407e779ceabe146aad777352a2e6af5f275c3c8.zip
Bad hacker! Don't implicitly assume that utf8 characters are one byte in
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) svn path=/trunk/; revision=13667
Diffstat (limited to 'mail/e-searching-tokenizer.c')
-rw-r--r--mail/e-searching-tokenizer.c10
1 files changed, 7 insertions, 3 deletions
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 {