Internally, force all "shortcuts" to be lowercase (due to RDF APIs being case-significant). When looking for a shortcut match, first lowercase it, then look through graph... this allows for a case-insignificant match.

This commit is contained in:
rjc%netscape.com 2007-09-12 17:47:50 +00:00
Родитель bdbaa00427
Коммит cd3e51d3bb
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -1037,9 +1037,10 @@ BookmarkParser::ParseBookmark(const nsString &aLine, const nsCOMPtr<nsIRDFContai
}
}
// 7. Parse the shortcut URL
// 7. Parse the shortcut URL (and always lowercase them before storing internally)
nsAutoString shortcut;
ParseAttribute(aLine, kShortcutURLEquals, sizeof(kShortcutURLEquals) -1, shortcut);
shortcut.ToLowerCase();
// 8. Parse the schedule
nsAutoString schedule;
@ -2927,8 +2928,12 @@ nsBookmarksService::FindShortcut(const PRUnichar *aUserInput, char **aShortcutUR
nsresult rv;
// shortcuts are always lowercased internally
nsAutoString shortcut(aUserInput);
shortcut.ToLowerCase();
nsCOMPtr<nsIRDFLiteral> literalTarget;
rv = gRDF->GetLiteral(aUserInput, getter_AddRefs(literalTarget));
rv = gRDF->GetLiteral(shortcut.GetUnicode(), getter_AddRefs(literalTarget));
if (NS_FAILED(rv)) return rv;
if (rv != NS_RDF_NO_VALUE)