Module: wine Branch: master Commit: 9b657fa0e7271c2ee222ede182631b30ca651a66 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9b657fa0e7271c2ee222ede182...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Oct 6 09:47:25 2008 -0500
mshtml: Added IDispatchEx support to HTMLCurrentStyle.
---
dlls/mshtml/dispex.c | 2 ++ dlls/mshtml/htmlcurstyle.c | 19 ++++++++++++++++--- dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/tests/dom.c | 2 ++ 4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 5bc8ea7..891d42c 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -68,6 +68,7 @@ static REFIID tid_ids[] = { &DIID_DispDOMChildrenCollection, &DIID_DispHTMLBody, &DIID_DispHTMLCommentElement, + &DIID_DispHTMLCurrentStyle, &DIID_DispHTMLDocument, &DIID_DispHTMLDOMTextNode, &DIID_DispHTMLElementCollection, @@ -84,6 +85,7 @@ static REFIID tid_ids[] = { &IID_IHTMLBodyElement, &IID_IHTMLBodyElement2, &IID_IHTMLCommentElement, + &IID_IHTMLCurrentStyle, &IID_IHTMLDocument2, &IID_IHTMLDocument3, &IID_IHTMLDocument4, diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 55ff842..4568087 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct { + DispatchEx dispex; const IHTMLCurrentStyleVtbl *lpIHTMLCurrentStyleVtbl;
LONG ref; @@ -51,12 +52,11 @@ static HRESULT WINAPI HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle *iface, if(IsEqualGUID(&IID_IUnknown, riid)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); *ppv = HTMLCURSTYLE(This); - }else if(IsEqualGUID(&IID_IDispatch, riid)) { - TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv); - *ppv = HTMLCURSTYLE(This); }else if(IsEqualGUID(&IID_IHTMLCurrentStyle, riid)) { TRACE("(%p)->(IID_IHTMLCurrentStyle %p)\n", This, ppv); *ppv = HTMLCURSTYLE(This); + }else if(dispex_query_interface(&This->dispex, riid, ppv)) { + return *ppv ? S_OK : E_NOINTERFACE; }
if(*ppv) { @@ -864,6 +864,17 @@ static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = { HTMLCurrentStyle_get_textTransform };
+static const tid_t HTMLCurrentStyle_iface_tids[] = { + IHTMLCurrentStyle_tid, + 0 +}; +static dispex_static_data_t HTMLCurrentStyle_dispex = { + NULL, + DispHTMLCurrentStyle_tid, + NULL, + HTMLCurrentStyle_iface_tids +}; + HRESULT HTMLCurrentStyle_Create(IHTMLCurrentStyle **p) { HTMLCurrentStyle *ret; @@ -875,6 +886,8 @@ HRESULT HTMLCurrentStyle_Create(IHTMLCurrentStyle **p) ret->lpIHTMLCurrentStyleVtbl = &HTMLCurrentStyleVtbl; ret->ref = 1;
+ init_dispex(&ret->dispex, (IUnknown*)HTMLCURSTYLE(ret), &HTMLCurrentStyle_dispex); + *p = HTMLCURSTYLE(ret); return S_OK; } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index c306505..5a1dfc3 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -64,6 +64,7 @@ typedef enum { DispDOMChildrenCollection_tid, DispHTMLBody_tid, DispHTMLCommentElement_tid, + DispHTMLCurrentStyle_tid, DispHTMLDocument_tid, DispHTMLDOMTextNode_tid, DispHTMLElementCollection_tid, @@ -80,6 +81,7 @@ typedef enum { IHTMLBodyElement_tid, IHTMLBodyElement2_tid, IHTMLCommentElement_tid, + IHTMLCurrentStyle_tid, IHTMLDocument2_tid, IHTMLDocument3_tid, IHTMLDocument4_tid, diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index fa11893..0753d15 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -281,6 +281,7 @@ static const IID * const style_iids[] = { static const IID * const cstyle_iids[] = { &IID_IUnknown, &IID_IDispatch, + &IID_IDispatchEx, &IID_IHTMLCurrentStyle, NULL }; @@ -1985,6 +1986,7 @@ static void test_navigator(IHTMLDocument2 *doc)
static void test_current_style(IHTMLCurrentStyle *current_style) { + test_disp((IUnknown*)current_style, &DIID_DispHTMLCurrentStyle); test_ifaces((IUnknown*)current_style, cstyle_iids); }