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.

git-svn-id: svn://10.0.0.236/trunk@64864 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rjc%netscape.com
2000-04-01 08:48:29 +00:00
parent 3d04a873f2
commit d8d4ecf9d9

View File

@@ -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)