Commit 75a2e8c4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use elem_string_attr_getter helper in HTMLLabelElement_get_htmlFor implementation.

parent 04ea007c
...@@ -1334,29 +1334,10 @@ static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BST ...@@ -1334,29 +1334,10 @@ static HRESULT WINAPI HTMLLabelElement_put_htmlFor(IHTMLLabelElement *iface, BST
static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BSTR *p) static HRESULT WINAPI HTMLLabelElement_get_htmlFor(IHTMLLabelElement *iface, BSTR *p)
{ {
HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface); HTMLLabelElement *This = impl_from_IHTMLLabelElement(iface);
nsAString for_str, val_str;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
nsAString_InitDepend(&for_str, forW); return elem_string_attr_getter(&This->element, forW, p);
nsAString_Init(&val_str, NULL);
nsres = nsIDOMHTMLElement_GetAttribute(This->element.nselem, &for_str, &val_str);
nsAString_Finish(&for_str);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *val;
nsAString_GetData(&val_str, &val);
*p = SysAllocString(val);
hres = *p ? S_OK : E_OUTOFMEMORY;
}else {
ERR("GetAttribute failed: %08x\n", nsres);
hres = E_FAIL;
}
nsAString_Finish(&val_str);
return hres;
} }
static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v) static HRESULT WINAPI HTMLLabelElement_put_accessKey(IHTMLLabelElement *iface, BSTR v)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment