Bug 661292 - Make nsChangeObserver::ContentInserted not use the index parameter. r=joshmoz

This commit is contained in:
Mounir Lamouri 2011-06-03 00:37:18 +02:00
Родитель ebfefa418e
Коммит b856b7b398
5 изменённых файлов: 15 добавлений и 15 удалений

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

@ -48,7 +48,7 @@ class nsIAtom;
#define NS_DECL_CHANGEOBSERVER \
void ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent, nsIAtom *aAttribute); \
void ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild, PRInt32 aIndexInContainer); \
void ObserveContentInserted(nsIDocument *aDocument, nsIContent *aChild, PRInt32 aIndexInContainer);
void ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer, nsIContent *aChild);
// Something that wants to be alerted to changes in attributes or changes in
// its corresponding content object.
@ -71,8 +71,8 @@ public:
PRInt32 aIndexInContainer)=0;
virtual void ObserveContentInserted(nsIDocument* aDocument,
nsIContent* aChild,
PRInt32 aIndexInContainer)=0;
nsIContent* aContainer,
nsIContent* aChild)=0;
};
#endif // nsChangeObserver_h_

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

@ -257,14 +257,14 @@ void nsMenuBarX::ObserveContentRemoved(nsIDocument* aDocument,
}
void nsMenuBarX::ObserveContentInserted(nsIDocument* aDocument,
nsIContent* aChild,
PRInt32 aIndexInContainer)
nsIContent* aContainer,
nsIContent* aChild)
{
nsMenuX* newMenu = new nsMenuX();
if (newMenu) {
nsresult rv = newMenu->Create(this, this, aChild);
if (NS_SUCCEEDED(rv))
InsertMenuAtIndex(newMenu, aIndexInContainer);
InsertMenuAtIndex(newMenu, aContainer->IndexOf(aChild));
else
delete newMenu;
}

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

@ -122,11 +122,10 @@ void nsMenuGroupOwnerX::CharacterDataChanged(nsIDocument* aDocument,
void nsMenuGroupOwnerX::ContentAppended(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aFirstNewContent,
PRInt32 aNewIndexInContainer)
PRInt32 /* unused */)
{
for (nsIContent* cur = aFirstNewContent; cur; cur = cur->GetNextSibling()) {
ContentInserted(aDocument, aContainer, cur, aNewIndexInContainer);
aNewIndexInContainer++;
ContentInserted(aDocument, aContainer, cur, 0);
}
}
@ -191,7 +190,7 @@ void nsMenuGroupOwnerX::ContentRemoved(nsIDocument * aDocument,
void nsMenuGroupOwnerX::ContentInserted(nsIDocument * aDocument,
nsIContent * aContainer,
nsIContent * aChild,
PRInt32 aIndexInContainer)
PRInt32 /* unused */)
{
if (!aContainer) {
return;
@ -200,7 +199,7 @@ void nsMenuGroupOwnerX::ContentInserted(nsIDocument * aDocument,
nsCOMPtr<nsIMutationObserver> kungFuDeathGrip(this);
nsChangeObserver* obs = LookupContentChangeObserver(aContainer);
if (obs)
obs->ObserveContentInserted(aDocument, aChild, aIndexInContainer);
obs->ObserveContentInserted(aDocument, aContainer, aChild);
else if (aContainer != mContent) {
// We do a lookup on the parent container in case things were removed
// under a "menupopup" item. That is basically a wrapper for the contents
@ -209,7 +208,7 @@ void nsMenuGroupOwnerX::ContentInserted(nsIDocument * aDocument,
if (parent) {
obs = LookupContentChangeObserver(parent);
if (obs)
obs->ObserveContentInserted(aDocument, aChild, aIndexInContainer);
obs->ObserveContentInserted(aDocument, aContainer, aChild);
}
}
}

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

@ -383,7 +383,8 @@ void nsMenuItemX::ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChi
mMenuParent->SetRebuild(PR_TRUE);
}
void nsMenuItemX::ObserveContentInserted(nsIDocument *aDocument, nsIContent *aChild, PRInt32 aIndexInContainer)
void nsMenuItemX::ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer,
nsIContent *aChild)
{
mMenuParent->SetRebuild(PR_TRUE);
}

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

@ -850,8 +850,8 @@ void nsMenuX::ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild,
mMenuGroupOwner->UnregisterForContentChanges(aChild);
}
void nsMenuX::ObserveContentInserted(nsIDocument *aDocument, nsIContent *aChild,
PRInt32 aIndexInContainer)
void nsMenuX::ObserveContentInserted(nsIDocument *aDocument, nsIContent* aContainer,
nsIContent *aChild)
{
if (gConstructingMenu)
return;