Jacek Caban : mshtml: Added beginning of getAttribute implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Mar 9 06:28:50 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 2c06b800b196887c287b6b2babb09edd989ec598
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=2c06b800b196887c287b6b2babb09edd989ec598
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Mar 9 08:35:58 2006 +0100
mshtml: Added beginning of getAttribute implementation.
---
dlls/mshtml/htmlelem.c | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c
index eb5f913..f08c578 100644
--- a/dlls/mshtml/htmlelem.c
+++ b/dlls/mshtml/htmlelem.c
@@ -142,9 +142,33 @@ static HRESULT WINAPI HTMLElement_getAtt
LONG lFlags, VARIANT *AttributeValue)
{
HTMLElement *This = HTMLELEM_THIS(iface);
- FIXME("(%p)->(%s %08lx %p)\n", This, debugstr_w(strAttributeName), lFlags,
- AttributeValue);
- return E_NOTIMPL;
+ nsAString attr_str;
+ nsAString value_str;
+ const PRUnichar *value;
+ nsresult nsres;
+ HRESULT hres = S_OK;
+
+ WARN("(%p)->(%s %08lx %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
+
+ nsAString_Init(&attr_str, strAttributeName);
+ nsAString_Init(&value_str, NULL);
+
+ nsres = nsIDOMHTMLElement_GetAttribute(This->nselem, &attr_str, &value_str);
+ nsAString_Finish(&attr_str);
+
+ if(NS_SUCCEEDED(nsres)) {
+ nsAString_GetData(&value_str, &value, NULL);
+ V_VT(AttributeValue) = VT_BSTR;
+ V_BSTR(AttributeValue) = SysAllocString(value);;
+ TRACE("attr_value=%s\n", debugstr_w(V_BSTR(AttributeValue)));
+ }else {
+ ERR("GetAttribute failed: %08lx\n", nsres);
+ hres = E_FAIL;
+ }
+
+ nsAString_Finish(&value_str);
+
+ return hres;
}
static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strAttributeName,
More information about the wine-cvs
mailing list