Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
248db8d8
Commit
248db8d8
authored
Jan 29, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Jan 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Optimize and clean up HTMLFormElement_get_dispid implementation.
parent
456e53bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
27 deletions
+20
-27
htmlform.c
dlls/mshtml/htmlform.c
+20
-27
No files found.
dlls/mshtml/htmlform.c
View file @
248db8d8
...
...
@@ -343,10 +343,12 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
{
HTMLFormElement
*
This
=
HTMLFORM_NODE_THIS
(
iface
);
nsIDOMHTMLCollection
*
elements
;
nsAString
nsname
,
nsstr
;
PRUint32
len
,
i
;
static
const
PRUnichar
nameW
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
0
};
nsAString
nsname
;
nsresult
nsres
;
HRESULT
hres
=
DISP_E_UNKNOWNNAME
;
static
const
PRUnichar
nameW
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
0
};
TRACE
(
"(%p)->(%s %x %p)
\n
"
,
This
,
wine_dbgstr_w
(
name
),
grfdex
,
pid
);
...
...
@@ -363,72 +365,63 @@ static HRESULT HTMLFormElement_get_dispid(HTMLDOMNode *iface,
return
E_FAIL
;
}
nsAString_Init
(
&
nsname
,
nameW
);
nsAString_InitDepend
(
&
nsname
,
nameW
);
nsAString_Init
(
&
nsstr
,
NULL
);
for
(
i
=
0
;
i
<
len
;
++
i
)
{
nsIDOMNode
*
nsitem
;
nsIDOMHTMLElement
*
nshtml_elem
;
nsAString
nsstr
;
const
PRUnichar
*
str
;
nsres
=
nsIDOMHTMLCollection_Item
(
elements
,
i
,
&
nsitem
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"Item failed: 0x%08x
\n
"
,
nsres
);
nsAString_Finish
(
&
nsname
);
nsIDOMHTMLCollection_Release
(
elements
);
return
E_FAIL
;
hres
=
E_FAIL
;
break
;
}
nsres
=
nsIDOMNode_QueryInterface
(
nsitem
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
&
nshtml_elem
);
nsIDOMNode_Release
(
nsitem
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"Failed to get nsIDOMHTMLNode interface: 0x%08x
\n
"
,
nsres
);
nsAString_Finish
(
&
nsname
);
nsIDOMHTMLCollection_Release
(
elements
);
return
E_FAIL
;
hres
=
E_FAIL
;
break
;
}
/* compare by id attr */
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLElement_GetId
(
nshtml_elem
,
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"GetId failed: 0x%08x
\n
"
,
nsres
);
nsAString_Finish
(
&
nsname
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
nsIDOMHTMLCollection_Release
(
elements
)
;
return
E_FAIL
;
hres
=
E_FAIL
;
break
;
}
nsAString_GetData
(
&
nsstr
,
&
str
);
if
(
!
strcmpiW
(
str
,
name
))
{
nsIDOMHTMLElement_Release
(
nshtml_elem
);
/* FIXME: using index for dispid */
*
pid
=
MSHTML_DISPID_CUSTOM_MIN
+
i
;
nsAString_Finish
(
&
nsname
);
nsAString_Finish
(
&
nsstr
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
nsIDOMHTMLCollection_Release
(
elements
);
return
S_OK
;
hres
=
S_OK
;
break
;
}
/* compare by name attr */
nsres
=
nsIDOMHTMLElement_GetAttribute
(
nshtml_elem
,
&
nsname
,
&
nsstr
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
nsAString_GetData
(
&
nsstr
,
&
str
);
if
(
!
strcmpiW
(
str
,
name
))
{
/* FIXME: using index for dispid */
*
pid
=
MSHTML_DISPID_CUSTOM_MIN
+
i
;
nsAString_Finish
(
&
nsname
);
nsAString_Finish
(
&
nsstr
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
nsIDOMHTMLCollection_Release
(
elements
);
return
S_OK
;
hres
=
S_OK
;
break
;
}
nsAString_Finish
(
&
nsstr
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
}
nsAString_Finish
(
&
nsname
);
nsAString_Finish
(
&
nsstr
);
nsIDOMHTMLCollection_Release
(
elements
);
return
DISP_E_UNKNOWNNAME
;
return
hres
;
}
static
HRESULT
HTMLFormElement_invoke
(
HTMLDOMNode
*
iface
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment