mshtml: Added IHTMLBodyElement::get_link implementation.

This commit is contained in:
Jacek Caban 2008-02-24 22:17:55 +01:00 committed by Alexandre Julliard
parent a7ba7647ad
commit 8d7e1922d8
1 changed files with 29 additions and 2 deletions

View File

@ -71,6 +71,21 @@ static BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr)
} }
static void nscolor_to_variant(const nsAString *nsstr, VARIANT *p)
{
const PRUnichar *color;
nsAString_GetData(nsstr, &color);
if(*color == '#') {
V_VT(p) = VT_I4;
V_I4(p) = strtolW(color+1, NULL, 16);
}else {
V_VT(p) = VT_BSTR;
V_BSTR(p) = SysAllocString(color);
}
}
#define HTMLBODY_THIS(iface) DEFINE_THIS(HTMLBodyElement, HTMLBodyElement, iface) #define HTMLBODY_THIS(iface) DEFINE_THIS(HTMLBodyElement, HTMLBodyElement, iface)
static HRESULT WINAPI HTMLBodyElement_QueryInterface(IHTMLBodyElement *iface, static HRESULT WINAPI HTMLBodyElement_QueryInterface(IHTMLBodyElement *iface,
@ -297,8 +312,20 @@ static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT
static HRESULT WINAPI HTMLBodyElement_get_link(IHTMLBodyElement *iface, VARIANT *p) static HRESULT WINAPI HTMLBodyElement_get_link(IHTMLBodyElement *iface, VARIANT *p)
{ {
HTMLBodyElement *This = HTMLBODY_THIS(iface); HTMLBodyElement *This = HTMLBODY_THIS(iface);
FIXME("(%p)->(%p)\n", This, p); nsAString link_str;
return E_NOTIMPL; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&link_str, NULL);
nsres = nsIDOMHTMLBodyElement_GetLink(This->nsbody, &link_str);
if(NS_FAILED(nsres))
ERR("GetLink failed: %08x\n", nsres);
nscolor_to_variant(&link_str, p);
nsAString_Finish(&link_str);
return S_OK;
} }
static HRESULT WINAPI HTMLBodyElement_put_vLink(IHTMLBodyElement *iface, VARIANT v) static HRESULT WINAPI HTMLBodyElement_put_vLink(IHTMLBodyElement *iface, VARIANT v)