Changed query in nsNavHistoryResultNode::Rebuild() to be a full query bound

by id instead of URL.
Changed QueriesToQueryString() and QueryStringToQueries() to make the query
string a place: url.
r=bryner bug=319894

Original committer: annie.sullivan%gmail.com
Original revision: 1.7
Original date: 2005/12/11 21:53:00
This commit is contained in:
benjamin%smedbergs.us 2006-07-18 17:00:14 +00:00
Родитель fa94d5b188
Коммит c915768f2f
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -147,7 +147,7 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries,
nsCOMPtr<nsNavHistoryQueryOptions> options = do_QueryInterface(aOptions);
NS_ENSURE_TRUE(options, NS_ERROR_INVALID_ARG);
aQueryString.Truncate(0);
aQueryString.AssignLiteral("place:");
for (PRUint32 queryIndex = 0; queryIndex < aQueryCount; queryIndex ++) {
nsINavHistoryQuery* query = aQueries[queryIndex];
if (queryIndex > 0) {
@ -314,7 +314,7 @@ public:
// Special case: if aKeyBegin == aEquals, then there is only one string
// and no equal sign, so we treat the entire thing as a key with no value
QueryKeyValuePair(const nsCString& aSource, PRInt32 aKeyBegin,
QueryKeyValuePair(const nsCSubstring& aSource, PRInt32 aKeyBegin,
PRInt32 aEquals, PRInt32 aPastEnd)
{
if (aEquals == aKeyBegin)
@ -346,11 +346,12 @@ FreeTokenList(nsVoidArray* aTokens)
nsresult
TokenizeQueryString(const nsACString& aQuery, nsVoidArray* aTokens)
{
nsCString query(aQuery);
// Strip of the "place:" prefix
const nsCSubstring &query = Substring(aQuery, strlen("place:"));
PRInt32 keyFirstIndex = 0;
PRInt32 equalsIndex = 0;
for (PRUint32 i = 0; i < aQuery.Length(); i ++) {
for (PRUint32 i = 0; i < query.Length(); i ++) {
if (query[i] == '&') {
// new clause, save last one
if (i - keyFirstIndex > 1) {