Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
9a9c5f9c
Commit
9a9c5f9c
authored
Nov 20, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Nov 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Also get dispid by element name & id in HTMLElementCollection.
parent
39214543
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
htmlelemcol.c
dlls/mshtml/htmlelemcol.c
+30
-1
No files found.
dlls/mshtml/htmlelemcol.c
View file @
9a9c5f9c
...
...
@@ -205,6 +205,26 @@ static HRESULT WINAPI HTMLElementCollection_get__newEnum(IHTMLElementCollection
return
E_NOTIMPL
;
}
static
BOOL
is_elem_id
(
HTMLElement
*
elem
,
LPCWSTR
name
)
{
BSTR
elem_id
;
HRESULT
hres
;
hres
=
IHTMLElement_get_id
(
HTMLELEM
(
elem
),
&
elem_id
);
if
(
FAILED
(
hres
)){
WARN
(
"IHTMLElement_get_id failed: 0x%08x
\n
"
,
hres
);
return
FALSE
;
}
if
(
elem_id
&&
!
strcmpW
(
elem_id
,
name
))
{
SysFreeString
(
elem_id
);
return
TRUE
;
}
SysFreeString
(
elem_id
);
return
FALSE
;
}
static
BOOL
is_elem_name
(
HTMLElement
*
elem
,
LPCWSTR
name
)
{
const
PRUnichar
*
str
;
...
...
@@ -376,7 +396,16 @@ static HRESULT HTMLElementCollection_get_dispid(IUnknown *iface, BSTR name, DWOR
for
(
ptr
=
name
;
*
ptr
&&
isdigitW
(
*
ptr
);
ptr
++
)
idx
=
idx
*
10
+
(
*
ptr
-
'0'
);
if
(
*
ptr
||
idx
>=
This
->
len
)
if
(
*
ptr
)
{
/* the name contains alpha characters, so search by name & id */
for
(
idx
=
0
;
idx
<
This
->
len
;
++
idx
)
{
if
(
is_elem_id
(
This
->
elems
[
idx
],
name
)
||
is_elem_name
(
This
->
elems
[
idx
],
name
))
break
;
}
}
if
(
idx
>=
This
->
len
)
return
DISP_E_UNKNOWNNAME
;
*
dispid
=
DISPID_ELEMCOL_0
+
idx
;
...
...
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