mshtml: Use get_elem_attr_value helper in is_elem_name.

This commit is contained in:
Jacek Caban 2014-05-27 11:29:28 +02:00 committed by Alexandre Julliard
parent 3efaaacf3c
commit d0898685a6
1 changed files with 3 additions and 6 deletions

View File

@ -368,7 +368,7 @@ static BOOL is_elem_id(HTMLElement *elem, LPCWSTR name)
static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name) static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
{ {
const PRUnichar *str; const PRUnichar *str;
nsAString nsstr, nsname; nsAString nsstr;
BOOL ret = FALSE; BOOL ret = FALSE;
nsresult nsres; nsresult nsres;
@ -385,15 +385,12 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
return TRUE; return TRUE;
} }
nsAString_InitDepend(&nsname, nameW); nsres = get_elem_attr_value(elem->nselem, nameW, &nsstr, &str);
nsres = nsIDOMHTMLElement_GetAttribute(elem->nselem, &nsname, &nsstr);
nsAString_Finish(&nsname);
if(NS_SUCCEEDED(nsres)) { if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&nsstr, &str);
ret = !strcmpiW(str, name); ret = !strcmpiW(str, name);
nsAString_Finish(&nsstr);
} }
nsAString_Finish(&nsstr);
return ret; return ret;
} }