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
b52bdff8
Commit
b52bdff8
authored
May 11, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
May 11, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved getting select's option element by index to separated function.
parent
061fee45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
27 deletions
+44
-27
htmlselect.c
dlls/mshtml/htmlselect.c
+44
-27
No files found.
dlls/mshtml/htmlselect.c
View file @
b52bdff8
...
...
@@ -42,6 +42,43 @@ typedef struct {
#define HTMLSELECT(x) ((IHTMLSelectElement*) &(x)->lpHTMLSelectElementVtbl)
static
HRESULT
htmlselect_item
(
HTMLSelectElement
*
This
,
int
i
,
IDispatch
**
ret
)
{
nsIDOMHTMLOptionsCollection
*
nscol
;
nsIDOMNode
*
nsnode
;
nsresult
nsres
;
nsres
=
nsIDOMHTMLSelectElement_GetOptions
(
This
->
nsselect
,
&
nscol
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetOptions failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMHTMLOptionsCollection_Item
(
nscol
,
i
,
&
nsnode
);
nsIDOMHTMLOptionsCollection_Release
(
nscol
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Item failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
if
(
nsnode
)
{
HTMLDOMNode
*
node
;
node
=
get_node
(
This
->
element
.
node
.
doc
,
nsnode
,
TRUE
);
nsIDOMNode_Release
(
nsnode
);
if
(
!
node
)
{
ERR
(
"Could not find node
\n
"
);
return
E_FAIL
;
}
IHTMLDOMNode_AddRef
(
HTMLDOMNODE
(
node
));
*
ret
=
(
IDispatch
*
)
HTMLDOMNODE
(
node
);
}
else
{
*
ret
=
NULL
;
}
return
S_OK
;
}
#define HTMLSELECT_THIS(iface) DEFINE_THIS(HTMLSelectElement, HTMLSelectElement, iface)
static
HRESULT
WINAPI
HTMLSelectElement_QueryInterface
(
IHTMLSelectElement
*
iface
,
...
...
@@ -534,36 +571,16 @@ static HRESULT HTMLSelectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
{
nsIDOMHTMLOptionsCollection
*
nscol
;
nsIDOMNode
*
nsnode
;
nsresult
nsres
;
nsres
=
nsIDOMHTMLSelectElement_GetOptions
(
This
->
nsselect
,
&
nscol
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetOptions failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMHTMLOptionsCollection_Item
(
nscol
,
id
-
DISPID_OPTIONCOL_0
,
&
nsnode
);
nsIDOMHTMLOptionsCollection_Release
(
nscol
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Item failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
if
(
nsnode
)
{
HTMLDOMNode
*
node
;
IDispatch
*
ret
;
HRESULT
hres
;
node
=
get_node
(
This
->
element
.
node
.
doc
,
nsnode
,
TRUE
);
nsIDOMNode_Release
(
nsnode
);
if
(
!
node
)
{
ERR
(
"Could not find node
\n
"
);
return
E_FAIL
;
}
hres
=
htmlselect_item
(
This
,
id
-
DISPID_OPTIONCOL_0
,
&
ret
);
if
(
FAILED
(
hres
))
return
hres
;
IHTMLDOMNode_AddRef
(
HTMLDOMNODE
(
node
));
if
(
ret
)
{
V_VT
(
res
)
=
VT_DISPATCH
;
V_DISPATCH
(
res
)
=
(
IDispatch
*
)
HTMLDOMNODE
(
node
)
;
V_DISPATCH
(
res
)
=
ret
;
}
else
{
V_VT
(
res
)
=
VT_NULL
;
}
...
...
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