Jacek Caban : mshtml: Added IHTMLStyleSheetsCollection::item implementation .
Alexandre Julliard
julliard at winehq.org
Mon Nov 26 08:16:20 CST 2007
Module: wine
Branch: master
Commit: c5953bec63bdb31db155317466ffc380ca77c4a1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c5953bec63bdb31db155317466ffc380ca77c4a1
Author: Jacek Caban <jacek at codeweavers.com>
Date: Sun Nov 25 19:09:20 2007 +0100
mshtml: Added IHTMLStyleSheetsCollection::item implementation.
---
dlls/mshtml/htmlstylesheet.c | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c
index 823e5f5..30c25ce 100644
--- a/dlls/mshtml/htmlstylesheet.c
+++ b/dlls/mshtml/htmlstylesheet.c
@@ -170,8 +170,38 @@ static HRESULT WINAPI HTMLStyleSheetsCollection_item(IHTMLStyleSheetsCollection
VARIANT *pvarIndex, VARIANT *pvarResult)
{
HTMLStyleSheetsCollection *This = HTMLSTYLESHEETSCOL_THIS(iface);
- FIXME("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p %p)\n", This, pvarIndex, pvarResult);
+
+ switch(V_VT(pvarIndex)) {
+ case VT_I4: {
+ nsIDOMStyleSheet *nsstylesheet;
+ nsresult nsres;
+
+ TRACE("index=%d\n", V_I4(pvarIndex));
+
+ nsres = nsIDOMStyleSheetList_Item(This->nslist, V_I4(pvarIndex), &nsstylesheet);
+ if(NS_FAILED(nsres) || !nsstylesheet) {
+ WARN("Item failed: %08x\n", nsres);
+ V_VT(pvarResult) = VT_EMPTY;
+ return E_INVALIDARG;
+ }
+
+ V_VT(pvarResult) = VT_DISPATCH;
+ V_DISPATCH(pvarResult) = (IDispatch*)HTMLStyleSheet_Create(nsstylesheet);
+
+ return S_OK;
+ }
+
+ case VT_BSTR:
+ FIXME("id=%s not implemented\n", debugstr_w(V_BSTR(pvarResult)));
+ return E_NOTIMPL;
+
+ default:
+ WARN("Invalid vt=%d\n", V_VT(pvarIndex));
+ }
+
+ return E_INVALIDARG;
}
#undef HTMLSTYLESHEETSCOL_THIS
More information about the wine-cvs
mailing list