Module: wine Branch: master Commit: 4196f83f49eadb951a9392f332e9d892dfd22582 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4196f83f49eadb951a9392f332...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Fri Sep 5 20:34:59 2008 +1000
mshtml: Implement IHTMLBodyElement get/put bgColor.
---
dlls/mshtml/htmlbody.c | 37 +++++++++++++++++++++++++++++++++---- 1 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 13c802e..140a0a5 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -257,15 +257,44 @@ static HRESULT WINAPI HTMLBodyElement_get_noWrap(IHTMLBodyElement *iface, VARIAN static HRESULT WINAPI HTMLBodyElement_put_bgColor(IHTMLBodyElement *iface, VARIANT v) { HTMLBodyElement *This = HTMLBODY_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + nsAString strColor; + nsresult nsres; + + TRACE("(%p)->()\n", This); + + if(!variant_to_nscolor(&v, &strColor)) + return S_OK; + + nsres = nsIDOMHTMLBodyElement_SetBgColor(This->nsbody, &strColor); + nsAString_Finish(&strColor); + if(NS_FAILED(nsres)) + ERR("SetBgColor failed: %08x\n", nsres); + + return S_OK; }
static HRESULT WINAPI HTMLBodyElement_get_bgColor(IHTMLBodyElement *iface, VARIANT *p) { HTMLBodyElement *This = HTMLBODY_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString strColor; + nsresult nsres; + const PRUnichar *color; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&strColor, NULL); + nsres = nsIDOMHTMLBodyElement_GetBgColor(This->nsbody, &strColor); + if(NS_FAILED(nsres)) + ERR("SetBgColor failed: %08x\n", nsres); + + nsAString_GetData(&strColor, &color); + + V_VT(p) = VT_BSTR; + V_BSTR(p) = SysAllocString(color); + + nsAString_Finish(&strColor); + + return S_OK; }
static HRESULT WINAPI HTMLBodyElement_put_text(IHTMLBodyElement *iface, VARIANT v)