mshtml: Added IHTMLObjectElement::get_width implementation.
authorJacek Caban <jacek@codeweavers.com>
Thu, 16 Aug 2012 13:42:20 +0000 (15:42 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 16 Aug 2012 15:13:39 +0000 (17:13 +0200)
dlls/mshtml/htmlobject.c

index 6c21814..6859749 100644 (file)
@@ -278,8 +278,28 @@ static HRESULT WINAPI HTMLObjectElement_put_width(IHTMLObjectElement *iface, VAR
 static HRESULT WINAPI HTMLObjectElement_get_width(IHTMLObjectElement *iface, VARIANT *p)
 {
     HTMLObjectElement *This = impl_from_IHTMLObjectElement(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString width_str;
+    nsresult nsres;
+    HRESULT hres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&width_str, NULL);
+    nsres = nsIDOMHTMLObjectElement_GetWidth(This->nsobject, &width_str);
+    if(NS_SUCCEEDED(nsres)) {
+        const PRUnichar *width;
+
+        nsAString_GetData(&width_str, &width);
+        V_VT(p) = VT_BSTR;
+        V_BSTR(p) = SysAllocString(width);
+        hres = V_BSTR(p) ? S_OK : E_OUTOFMEMORY;
+    }else {
+        ERR("GetWidth failed: %08x\n", nsres);
+        hres = E_FAIL;
+    }
+
+    nsAString_Finish(&width_str);
+    return hres;
 }
 
 static HRESULT WINAPI HTMLObjectElement_put_height(IHTMLObjectElement *iface, VARIANT v)