[XForms] Using repeat index for 1.1 delete does not work. Bug 387738, p=msterlin r=doronr+aaronr

git-svn-id: svn://10.0.0.236/trunk@229837 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronr%us.ibm.com
2007-07-12 20:32:49 +00:00
parent b5b433a6b7
commit 96273d8999

View File

@@ -438,8 +438,7 @@ nsXFormsInsertDeleteElement::HandleAction(nsIDOMEvent *aEvent,
nsCOMPtr<nsIDOMDocument> locationDoc;
nsCOMPtr<nsIDOMElement> locationDocElement;
nsCOMPtr<nsIDOMNode> parentNode, newNode, resNode;
nsCOMPtr<nsIDOMNode> parentNode, newNode, resNode, instNode;
if (mIsInsert) {
// The cloned node or nodes are inserted in the order they were cloned at
// their target location depending on their node type.
@@ -517,6 +516,8 @@ nsXFormsInsertDeleteElement::HandleAction(nsIDOMEvent *aEvent,
}
}
}
rv = nsXFormsUtils::GetInstanceNodeForData(resNode, getter_AddRefs(instNode));
NS_ENSURE_SUCCESS(rv, rv);
// Step 8: Set indexes for repeats
rv = RefreshRepeats(&cloneNodes);
@@ -551,6 +552,9 @@ nsXFormsInsertDeleteElement::HandleAction(nsIDOMEvent *aEvent,
locationNode->GetOwnerDocument(getter_AddRefs(locationDoc));
NS_ENSURE_STATE(locationDoc);
rv = nsXFormsUtils::GetInstanceNodeForData(locationNode, getter_AddRefs(instNode));
NS_ENSURE_SUCCESS(rv, rv);
locationDoc->GetDocumentElement(getter_AddRefs(locationDocElement));
while ((deleteIndex < deleteCount) && locationNode) {
// Delete the node(s) unless the delete location is the root document
@@ -579,9 +583,6 @@ nsXFormsInsertDeleteElement::HandleAction(nsIDOMEvent *aEvent,
// Dispatch xforms-insert/delete event to the instance node we have modified
// data for
nsCOMPtr<nsIDOMNode> instNode;
rv = nsXFormsUtils::GetInstanceNodeForData(locationNode, getter_AddRefs(instNode));
NS_ENSURE_SUCCESS(rv, rv);
rv = nsXFormsUtils::DispatchEvent(instNode,
mIsInsert ? eEvent_Insert : eEvent_Delete);
NS_ENSURE_SUCCESS(rv, rv);