Backing out bug 404370, which caused sortFolderByName to fail (in test_placesTxn).

This commit is contained in:
mozilla.mano@sent.com 2007-11-19 19:28:27 -08:00
Родитель b71351a775
Коммит c260813837
1 изменённых файлов: 12 добавлений и 26 удалений

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

@ -932,14 +932,10 @@ nsNavBookmarks::InsertBookmark(PRInt64 aFolder, nsIURI *aItem, PRInt32 aIndex,
nsresult rv = History()->GetUrlIdFor(aItem, &childID, PR_TRUE); nsresult rv = History()->GetUrlIdFor(aItem, &childID, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
PRInt32 index; PRInt32 index = (aIndex == -1) ? FolderCount(aFolder) : aIndex;
if (aIndex == nsINavBookmarksService::DEFAULT_INDEX) {
index = FolderCount(aFolder); rv = AdjustIndices(aFolder, index, PR_INT32_MAX, 1);
} else { NS_ENSURE_SUCCESS(rv, rv);
index = aIndex;
rv = AdjustIndices(aFolder, index, PR_INT32_MAX, 1);
NS_ENSURE_SUCCESS(rv, rv);
}
mozStorageStatementScoper scope(mDBInsertBookmark); mozStorageStatementScoper scope(mDBInsertBookmark);
rv = mDBInsertBookmark->BindInt64Parameter(0, childID); rv = mDBInsertBookmark->BindInt64Parameter(0, childID);
@ -1110,15 +1106,10 @@ nsNavBookmarks::CreateContainerWithID(PRInt64 aItemId, PRInt64 aParent,
mozIStorageConnection *dbConn = DBConn(); mozIStorageConnection *dbConn = DBConn();
mozStorageTransaction transaction(dbConn, PR_FALSE); mozStorageTransaction transaction(dbConn, PR_FALSE);
PRInt32 index; PRInt32 index = (*aIndex == -1) ? FolderCount(aParent) : *aIndex;
nsresult rv;
if (*aIndex == nsINavBookmarksService::DEFAULT_INDEX) { nsresult rv = AdjustIndices(aParent, index, PR_INT32_MAX, 1);
index = FolderCount(aParent); NS_ENSURE_SUCCESS(rv, rv);
} else {
index = *aIndex;
rv = AdjustIndices(aParent, index, PR_INT32_MAX, 1);
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr<mozIStorageStatement> statement; nsCOMPtr<mozIStorageStatement> statement;
if (aItemId == -1) { if (aItemId == -1) {
@ -1185,15 +1176,10 @@ nsNavBookmarks::InsertSeparator(PRInt64 aParent, PRInt32 aIndex,
mozIStorageConnection *dbConn = DBConn(); mozIStorageConnection *dbConn = DBConn();
mozStorageTransaction transaction(dbConn, PR_FALSE); mozStorageTransaction transaction(dbConn, PR_FALSE);
PRInt32 index; PRInt32 index = (aIndex == -1) ? FolderCount(aParent) : aIndex;
nsresult rv;
if (aIndex == nsINavBookmarksService::DEFAULT_INDEX) { nsresult rv = AdjustIndices(aParent, index, PR_INT32_MAX, 1);
index = FolderCount(aParent); NS_ENSURE_SUCCESS(rv, rv);
} else {
index = aIndex;
rv = AdjustIndices(aParent, index, PR_INT32_MAX, 1);
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr<mozIStorageStatement> statement; nsCOMPtr<mozIStorageStatement> statement;
rv = dbConn->CreateStatement(NS_LITERAL_CSTRING("INSERT INTO moz_bookmarks " rv = dbConn->CreateStatement(NS_LITERAL_CSTRING("INSERT INTO moz_bookmarks "