[PATCH] Implement get/put bgColor

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Fri Sep 5 05:34:59 CDT 2008


---
 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..08928e5 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)
-- 
1.5.4.1


--------------090006000102060605040309--



More information about the wine-patches mailing list