mshtml: Added IDispatchEx support to HTMLDOMChildrenCollection.
authorJacek Caban <jacek@codeweavers.com>
Wed, 30 Apr 2008 16:18:09 +0000 (18:18 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 1 May 2008 08:57:34 +0000 (10:57 +0200)
dlls/mshtml/dispex.c
dlls/mshtml/htmlnode.c
dlls/mshtml/mshtml_private.h

index 6f17a9db3c770e1e13fed6d981bc79229efccbff..f0cfc59893f13865fe36b2305fe3eb700e2d2967 100644 (file)
@@ -51,6 +51,7 @@ static struct list dispex_data_list = LIST_INIT(dispex_data_list);
 
 static REFIID tid_ids[] = {
     &IID_NULL,
+    &DIID_DispDOMChildrenCollection,
     &DIID_DispHTMLDocument,
     &DIID_DispHTMLDOMTextNode,
     &DIID_DispHTMLElementCollection,
@@ -62,6 +63,7 @@ static REFIID tid_ids[] = {
     &IID_IHTMLDocument3,
     &IID_IHTMLDocument4,
     &IID_IHTMLDocument5,
+    &IID_IHTMLDOMChildrenCollection,
     &IID_IHTMLDOMNode,
     &IID_IHTMLDOMNode2,
     &IID_IHTMLDOMTextNode,
index dbb35e1062335696a00ec4969d933c79e7a58325..1a9bea3e54837ac9a08dcf33bead94f4fa7f05d2 100644 (file)
@@ -32,6 +32,7 @@
 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
 
 typedef struct {
+    DispatchEx dispex;
     const IHTMLDOMChildrenCollectionVtbl  *lpIHTMLDOMChildrenCollectionVtbl;
 
     LONG ref;
@@ -58,6 +59,9 @@ static HRESULT WINAPI HTMLDOMChildrenCollection_QueryInterface(IHTMLDOMChildrenC
     }else if(IsEqualGUID(&IID_IDispatch, riid)) {
         TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
         *ppv = HTMLCHILDCOL(This);
+    }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
+        TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
+        *ppv = DISPATCHEX(&This->dispex);
     }else if(IsEqualGUID(&IID_IHTMLDOMChildrenCollection, riid)) {
         TRACE("(%p)->(IID_IHTMLDOMChildrenCollection %p)\n", This, ppv);
         *ppv = HTMLCHILDCOL(This);
@@ -189,6 +193,16 @@ static const IHTMLDOMChildrenCollectionVtbl HTMLDOMChildrenCollectionVtbl = {
     HTMLDOMChildrenCollection_item
 };
 
+static dispex_static_data_t HTMLDOMChildrenCollection_dispex = {
+    NULL,
+    DispDOMChildrenCollection_tid,
+    NULL,
+    {
+        IHTMLDOMChildrenCollection_tid,
+        0
+    }
+};
+
 static IHTMLDOMChildrenCollection *create_child_collection(HTMLDocument *doc, nsIDOMNodeList *nslist)
 {
     HTMLDOMChildrenCollection *ret;
@@ -201,6 +215,8 @@ static IHTMLDOMChildrenCollection *create_child_collection(HTMLDocument *doc, ns
     ret->nslist = nslist;
     ret->doc = doc;
 
+    init_dispex(&ret->dispex, (IUnknown*)HTMLCHILDCOL(ret), &HTMLDOMChildrenCollection_dispex);
+
     return HTMLCHILDCOL(ret);
 }
 
index 55c0090ea9648783f3db5f249137c7424e2280f6..92d63a2225811cd5778ea461b633d2c4f0a3b2b6 100644 (file)
@@ -61,6 +61,7 @@ typedef struct event_target_t event_target_t;
 /* NOTE: make sure to keep in sync with dispex.c */
 typedef enum {
     NULL_tid,
+    DispDOMChildrenCollection_tid,
     DispHTMLDocument_tid,
     DispHTMLDOMTextNode_tid,
     DispHTMLElementCollection_tid,
@@ -72,6 +73,7 @@ typedef enum {
     IHTMLDocument3_tid,
     IHTMLDocument4_tid,
     IHTMLDocument5_tid,
+    IHTMLDOMChildrenCollection_tid,
     IHTMLDOMNode_tid,
     IHTMLDOMNode2_tid,
     IHTMLDOMTextNode_tid,