зеркало из https://github.com/mozilla/gecko-dev.git
Bug 131470 - Case insensitive history search
patch by borggraefe@despammed.com r=neil sr=alecf
This commit is contained in:
Родитель
6312f04201
Коммит
b292076e17
|
@ -3861,23 +3861,22 @@ nsGlobalHistory::RowMatches(nsIMdbRow *aRow,
|
|||
NS_ConvertUCS2toUTF8 utf8Value(term->text);
|
||||
|
||||
if (term->method.Equals("is")) {
|
||||
|
||||
if (utf8Value != rowVal)
|
||||
if (!utf8Value.Equals(rowVal, nsCaseInsensitiveCStringComparator()))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
else if (term->method.Equals("isnot")) {
|
||||
if (utf8Value == rowVal)
|
||||
if (utf8Value.Equals(rowVal, nsCaseInsensitiveCStringComparator()))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
else if (term->method.Equals("contains")) {
|
||||
if (!FindInReadable(utf8Value, start, end))
|
||||
if (!FindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
else if (term->method.Equals("doesntcontain")) {
|
||||
if (FindInReadable(utf8Value, start, end))
|
||||
if (FindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
@ -3885,7 +3884,7 @@ nsGlobalHistory::RowMatches(nsIMdbRow *aRow,
|
|||
// need to make sure that the found string is
|
||||
// at the beginning of the string
|
||||
nsACString::const_iterator real_start = start;
|
||||
if (!(FindInReadable(utf8Value, start, end) &&
|
||||
if (!(FindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()) &&
|
||||
real_start == start))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -3894,7 +3893,7 @@ nsGlobalHistory::RowMatches(nsIMdbRow *aRow,
|
|||
// need to make sure that the found string ends
|
||||
// at the end of the string
|
||||
nsACString::const_iterator real_end = end;
|
||||
if (!(RFindInReadable(utf8Value, start, end) &&
|
||||
if (!(RFindInReadable(utf8Value, start, end, nsCaseInsensitiveCStringComparator()) &&
|
||||
real_end == end))
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче