mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 23:33:38 +00:00
mshtml: Remove no longer needed get_attr_from_nselem function.
This commit is contained in:
parent
1d4d1068cd
commit
6e1ad65dc3
|
@ -556,58 +556,6 @@ static HRESULT WINAPI HTMLElement4_normalize(IHTMLElement4 *iface)
|
|||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/* FIXME: This should be done in IDispatchEx implementation layer */
|
||||
static BOOL get_attr_from_nselem(HTMLElement *This, BSTR name, DISPID *dispid)
|
||||
{
|
||||
const PRUnichar *v;
|
||||
nsIDOMAttr *nsattr;
|
||||
nsAString nsstr;
|
||||
BSTR val = NULL;
|
||||
nsresult nsres;
|
||||
HRESULT hres;
|
||||
|
||||
nsAString_InitDepend(&nsstr, name);
|
||||
nsres = nsIDOMHTMLElement_GetAttributeNode(This->nselem, &nsstr, &nsattr);
|
||||
nsAString_Finish(&nsstr);
|
||||
if(NS_FAILED(nsres) || !nsattr)
|
||||
return FALSE;
|
||||
|
||||
FIXME("HACK\n");
|
||||
|
||||
nsAString_Init(&nsstr, NULL);
|
||||
nsres = nsIDOMAttr_GetNodeValue(nsattr, &nsstr);
|
||||
if(NS_FAILED(nsres)) {
|
||||
nsAString_Finish(&nsstr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
nsAString_GetData(&nsstr, &v);
|
||||
if(*v) {
|
||||
val = SysAllocString(v);
|
||||
if(!val) {
|
||||
nsAString_Finish(&nsstr);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
nsAString_Finish(&nsstr);
|
||||
|
||||
hres = IDispatchEx_GetDispID(&This->node.dispex.IDispatchEx_iface, name, fdexNameEnsure, dispid);
|
||||
if(SUCCEEDED(hres)) {
|
||||
VARIANT arg;
|
||||
DISPPARAMS dp = {&arg, NULL, 1, 0};
|
||||
EXCEPINFO ei;
|
||||
|
||||
V_VT(&arg) = VT_BSTR;
|
||||
V_BSTR(&arg) = val;
|
||||
memset(&ei, 0, sizeof(ei));
|
||||
hres = IDispatchEx_InvokeEx(&This->node.dispex.IDispatchEx_iface, *dispid,
|
||||
LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
|
||||
}
|
||||
|
||||
SysFreeString(val);
|
||||
return SUCCEEDED(hres);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement4_getAttributeNode(IHTMLElement4 *iface, BSTR bstrname, IHTMLDOMAttribute **ppAttribute)
|
||||
{
|
||||
HTMLElement *This = impl_from_IHTMLElement4(iface);
|
||||
|
@ -619,10 +567,8 @@ static HRESULT WINAPI HTMLElement4_getAttributeNode(IHTMLElement4 *iface, BSTR b
|
|||
|
||||
hres = IDispatchEx_GetDispID(&This->node.dispex.IDispatchEx_iface, bstrname, fdexNameCaseInsensitive, &dispid);
|
||||
if(hres == DISP_E_UNKNOWNNAME) {
|
||||
if(!get_attr_from_nselem(This, bstrname, &dispid)) {
|
||||
*ppAttribute = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
*ppAttribute = NULL;
|
||||
return S_OK;
|
||||
}else if(FAILED(hres)) {
|
||||
return hres;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue