зеркало из https://github.com/mozilla/gecko-dev.git
Bug 56570 - tree crash doing shift-click after deleting selected item. r=brendan, sr/a=hyatt.
This commit is contained in:
Родитель
169089589e
Коммит
a526fdd82b
|
@ -45,6 +45,7 @@ public:
|
|||
static const nsIID& GetIID() { static nsIID iid = NS_IXULTREECONTENT_IID; return iid; }
|
||||
|
||||
NS_IMETHOD FireOnSelectHandler() = 0;
|
||||
NS_IMETHOD CheckSelection(nsIDOMXULElement* aDeletedItem) = 0;
|
||||
};
|
||||
|
||||
#endif // nsIXULTreeContent_h__
|
||||
|
|
|
@ -2474,6 +2474,10 @@ nsXULElement::RemoveChildAt(PRInt32 aIndex, PRBool aNotify)
|
|||
if (IsAncestor(parentKid, node)) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(node);
|
||||
content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::selected, PR_FALSE);
|
||||
nsCOMPtr<nsIXULTreeContent> tree = do_QueryInterface(treeElement);
|
||||
nsCOMPtr<nsIDOMXULElement> domxulnode = do_QueryInterface(node);
|
||||
if (tree && domxulnode)
|
||||
tree->CheckSelection(domxulnode);
|
||||
length--;
|
||||
i--;
|
||||
fireSelectionHandler = PR_TRUE;
|
||||
|
|
|
@ -483,6 +483,14 @@ nsXULTreeElement::SetCurrentItem(nsIDOMXULElement* aCurrentItem)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULTreeElement::CheckSelection(nsIDOMXULElement* aDeletedItem)
|
||||
{
|
||||
if (aDeletedItem == mSelectionStart)
|
||||
mSelectionStart = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsXULTreeElement::SelectCallback(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
|
@ -494,3 +502,4 @@ nsXULTreeElement::SelectCallback(nsITimer *aTimer, void *aClosure)
|
|||
}
|
||||
} // sTimerCallback
|
||||
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
|
||||
// nsIXULTreeContent interface
|
||||
NS_IMETHOD FireOnSelectHandler();
|
||||
NS_IMETHOD CheckSelection(nsIDOMXULElement* aDeletedItem);
|
||||
|
||||
static nsIAtom* kSelectedAtom;
|
||||
static nsIAtom* kOpenAtom;
|
||||
|
|
|
@ -45,6 +45,7 @@ public:
|
|||
static const nsIID& GetIID() { static nsIID iid = NS_IXULTREECONTENT_IID; return iid; }
|
||||
|
||||
NS_IMETHOD FireOnSelectHandler() = 0;
|
||||
NS_IMETHOD CheckSelection(nsIDOMXULElement* aDeletedItem) = 0;
|
||||
};
|
||||
|
||||
#endif // nsIXULTreeContent_h__
|
||||
|
|
|
@ -2474,6 +2474,10 @@ nsXULElement::RemoveChildAt(PRInt32 aIndex, PRBool aNotify)
|
|||
if (IsAncestor(parentKid, node)) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(node);
|
||||
content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::selected, PR_FALSE);
|
||||
nsCOMPtr<nsIXULTreeContent> tree = do_QueryInterface(treeElement);
|
||||
nsCOMPtr<nsIDOMXULElement> domxulnode = do_QueryInterface(node);
|
||||
if (tree && domxulnode)
|
||||
tree->CheckSelection(domxulnode);
|
||||
length--;
|
||||
i--;
|
||||
fireSelectionHandler = PR_TRUE;
|
||||
|
|
|
@ -483,6 +483,14 @@ nsXULTreeElement::SetCurrentItem(nsIDOMXULElement* aCurrentItem)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULTreeElement::CheckSelection(nsIDOMXULElement* aDeletedItem)
|
||||
{
|
||||
if (aDeletedItem == mSelectionStart)
|
||||
mSelectionStart = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsXULTreeElement::SelectCallback(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
|
@ -494,3 +502,4 @@ nsXULTreeElement::SelectCallback(nsITimer *aTimer, void *aClosure)
|
|||
}
|
||||
} // sTimerCallback
|
||||
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
|
||||
// nsIXULTreeContent interface
|
||||
NS_IMETHOD FireOnSelectHandler();
|
||||
NS_IMETHOD CheckSelection(nsIDOMXULElement* aDeletedItem);
|
||||
|
||||
static nsIAtom* kSelectedAtom;
|
||||
static nsIAtom* kOpenAtom;
|
||||
|
|
Загрузка…
Ссылка в новой задаче