Implement CloneState() for nsXFormsContextContainer to clone the model, node, context position, and context size. Merge from XFORMS_20050106_BRANCH.

This commit is contained in:
bryner%brianryner.com 2005-01-28 19:03:13 +00:00
Родитель 0c7f295b2e
Коммит 94e993acd1
1 изменённых файлов: 17 добавлений и 0 удалений

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

@ -86,6 +86,7 @@ public:
// nsIXTFElement overrides
NS_IMETHOD OnDestroyed();
NS_IMETHOD CloneState(nsIDOMElement *aElement);
// nsIXFormsControl
NS_IMETHOD Refresh();
@ -165,6 +166,22 @@ nsXFormsContextContainer::OnDestroyed()
return nsXFormsControlStub::OnDestroyed();
}
NS_IMETHODIMP
nsXFormsContextContainer::CloneState(nsIDOMElement *aElement)
{
nsCOMPtr<nsIXFormsContextControl> other = do_QueryInterface(aElement);
if (!other) {
NS_WARNING("CloneState called with a different type source node");
return NS_ERROR_FAILURE;
}
nsAutoString modelID;
PRInt32 position, size;
other->GetContext(modelID, getter_AddRefs(mContextNode), &position, &size);
return NS_OK;
}
// nsIXFormsContextControl
NS_IMETHODIMP
nsXFormsContextContainer::SetContextNode(nsIDOMNode *aContextNode)