Jacek Caban : mshtml: Added IHTMLBodyElement::get_link implementation.

Alexandre Julliard julliard at winehq.org
Mon Feb 25 06:51:09 CST 2008


Module: wine
Branch: master
Commit: 8d7e1922d834c1591f2d9a432023262adcb8b899
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8d7e1922d834c1591f2d9a432023262adcb8b899

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sun Feb 24 22:17:55 2008 +0100

mshtml: Added IHTMLBodyElement::get_link implementation.

---

 dlls/mshtml/htmlbody.c |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c
index 8bd60e2..d0ee45a 100644
--- a/dlls/mshtml/htmlbody.c
+++ b/dlls/mshtml/htmlbody.c
@@ -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)
 
 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)
 {
     HTMLBodyElement *This = HTMLBODY_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString link_str;
+    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)




More information about the wine-cvs mailing list