Bug 131470 - Case insensitive history search

patch by borggraefe@despammed.com r=neil sr=alecf
This commit is contained in:
timeless%mozdev.org 2003-12-23 09:04:07 +00:00
Родитель 6312f04201
Коммит b292076e17
1 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -3861,23 +3861,22 @@ nsGlobalHistory::RowMatches(nsIMdbRow *aRow,
NS_ConvertUCS2toUTF8 utf8Value(term->text); NS_ConvertUCS2toUTF8 utf8Value(term->text);
if (term->method.Equals("is")) { if (term->method.Equals("is")) {
if (!utf8Value.Equals(rowVal, nsCaseInsensitiveCStringComparator()))
if (utf8Value != rowVal)
return PR_FALSE; return PR_FALSE;
} }
else if (term->method.Equals("isnot")) { else if (term->method.Equals("isnot")) {
if (utf8Value == rowVal) if (utf8Value.Equals(rowVal, nsCaseInsensitiveCStringComparator()))
return PR_FALSE; return PR_FALSE;
} }
else if (term->method.Equals("contains")) { else if (term->method.Equals("contains")) {
if (!FindInReadable(utf8Value, start, end)) if (!FindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()))
return PR_FALSE; return PR_FALSE;
} }
else if (term->method.Equals("doesntcontain")) { else if (term->method.Equals("doesntcontain")) {
if (FindInReadable(utf8Value, start, end)) if (FindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()))
return PR_FALSE; return PR_FALSE;
} }
@ -3885,7 +3884,7 @@ nsGlobalHistory::RowMatches(nsIMdbRow *aRow,
// need to make sure that the found string is // need to make sure that the found string is
// at the beginning of the string // at the beginning of the string
nsACString::const_iterator real_start = start; nsACString::const_iterator real_start = start;
if (!(FindInReadable(utf8Value, start, end) && if (!(FindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()) &&
real_start == start)) real_start == start))
return PR_FALSE; return PR_FALSE;
} }
@ -3894,7 +3893,7 @@ nsGlobalHistory::RowMatches(nsIMdbRow *aRow,
// need to make sure that the found string ends // need to make sure that the found string ends
// at the end of the string // at the end of the string
nsACString::const_iterator real_end = end; nsACString::const_iterator real_end = end;
if (!(RFindInReadable(utf8Value, start, end) && if (!(RFindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()) &&
real_end == end)) real_end == end))
return PR_FALSE; return PR_FALSE;
} }