Jacek Caban : mshtml: Added IHTMLDOMChildrenCollection::item implementation .
Alexandre Julliard
julliard at winehq.org
Thu May 1 06:38:37 CDT 2008
Module: wine
Branch: master
Commit: 6da1c730476930f086286ef02de9aa71f6f79914
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6da1c730476930f086286ef02de9aa71f6f79914
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Apr 30 18:17:56 2008 +0200
mshtml: Added IHTMLDOMChildrenCollection::item implementation.
---
dlls/mshtml/htmlnode.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c
index 73c588a..dbb35e1 100644
--- a/dlls/mshtml/htmlnode.c
+++ b/dlls/mshtml/htmlnode.c
@@ -153,8 +153,25 @@ static HRESULT WINAPI HTMLDOMChildrenCollection__newEnum(IHTMLDOMChildrenCollect
static HRESULT WINAPI HTMLDOMChildrenCollection_item(IHTMLDOMChildrenCollection *iface, long index, IDispatch **ppItem)
{
HTMLDOMChildrenCollection *This = HTMLCHILDCOL_THIS(iface);
- FIXME("(%p)->(%ld %p)\n", This, index, ppItem);
- return E_NOTIMPL;
+ nsIDOMNode *nsnode = NULL;
+ PRUint32 length=0;
+ nsresult nsres;
+
+ TRACE("(%p)->(%ld %p)\n", This, index, ppItem);
+
+ nsIDOMNodeList_GetLength(This->nslist, &length);
+ if(index < 0 || index > length)
+ return E_INVALIDARG;
+
+ nsres = nsIDOMNodeList_Item(This->nslist, index, &nsnode);
+ if(NS_FAILED(nsres) || !nsnode) {
+ ERR("Item failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *ppItem = (IDispatch*)get_node(This->doc, nsnode, TRUE);
+ IDispatch_AddRef(*ppItem);
+ return S_OK;
}
#undef HTMLCHILDCOL_THIS
More information about the wine-cvs
mailing list