Adjust index, not aIndex, to account for the hole caused by removing an already-present item. r=brettw.
git-svn-id: svn://10.0.0.236/trunk@186126 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
8e7ccad57f
commit
cc989f0be0
@ -532,8 +532,8 @@ nsNavBookmarks::InsertItem(PRInt64 aFolder, nsIURI *aItem, PRInt32 aIndex)
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// since we just removed the item, everything after it shifts back by one
|
||||
if (aIndex > previousIndex)
|
||||
aIndex --;
|
||||
if (index > previousIndex)
|
||||
index --;
|
||||
}
|
||||
|
||||
rv = AdjustIndices(aFolder, index, PR_INT32_MAX, 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user