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
adafcda4
Commit
adafcda4
authored
Nov 03, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: HTMLWindow_item code clean up.
parent
816802cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
30 deletions
+25
-30
htmlwindow.c
dlls/mshtml/htmlwindow.c
+25
-30
No files found.
dlls/mshtml/htmlwindow.c
View file @
adafcda4
...
...
@@ -323,8 +323,8 @@ static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex,
{
HTMLWindow
*
This
=
impl_from_IHTMLWindow2
(
iface
);
nsIDOMWindowCollection
*
nsFrames
;
HTMLWindow
*
window
;
HRESULT
hres
;
HTMLWindow
*
window
=
NULL
;
HRESULT
hres
=
S_OK
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
pvarIndex
,
pvarResult
);
...
...
@@ -335,29 +335,28 @@ static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex,
return
E_FAIL
;
}
if
(
V_VT
(
pvarIndex
)
==
VT_I4
)
{
switch
(
V_VT
(
pvarIndex
))
{
case
VT_I4
:
{
int
index
=
V_I4
(
pvarIndex
);
TRACE
(
"Getting index %d
\n
"
,
index
);
if
(
index
<
0
)
{
hres
=
DISP_E_MEMBERNOTFOUND
;
goto
cleanup
;
}
if
(
index
<
0
)
break
;
hres
=
get_frame_by_index
(
nsFrames
,
index
,
&
window
);
if
(
FAILED
(
hres
))
goto
cleanup
;
}
else
if
(
V_VT
(
pvarIndex
)
==
VT_UINT
)
{
break
;
}
case
VT_UINT
:
{
unsigned
int
index
=
V_UINT
(
pvarIndex
);
TRACE
(
"Getting index %u
\n
"
,
index
);
hres
=
get_frame_by_index
(
nsFrames
,
index
,
&
window
);
if
(
FAILED
(
hres
))
goto
cleanup
;
}
else
if
(
V_VT
(
pvarIndex
)
==
VT_BSTR
)
{
break
;
}
case
VT_BSTR
:
{
BSTR
str
=
V_BSTR
(
pvarIndex
);
PRUint32
length
,
i
;
TRACE
(
"Getting name %s
\n
"
,
wine_dbgstr_w
(
str
));
ns
res
=
ns
IDOMWindowCollection_GetLength
(
nsFrames
,
&
length
);
nsIDOMWindowCollection_GetLength
(
nsFrames
,
&
length
);
window
=
NULL
;
for
(
i
=
0
;
i
<
length
&&
!
window
;
++
i
)
{
...
...
@@ -369,7 +368,7 @@ static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex,
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"nsIDOMWindowCollection_Item failed: 0x%08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
goto
cleanup
;
break
;
}
cur_window
=
nswindow_to_window
(
nsWindow
);
...
...
@@ -379,7 +378,7 @@ static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex,
hres
=
IHTMLElement_get_id
(
&
cur_window
->
frame_element
->
element
.
IHTMLElement_iface
,
&
id
);
if
(
FAILED
(
hres
))
{
FIXME
(
"IHTMLElement_get_id failed: 0x%08x
\n
"
,
hres
);
goto
cleanup
;
break
;
}
if
(
!
strcmpW
(
id
,
str
))
...
...
@@ -387,26 +386,22 @@ static HRESULT WINAPI HTMLWindow2_item(IHTMLWindow2 *iface, VARIANT *pvarIndex,
SysFreeString
(
id
);
}
if
(
!
window
)
{
hres
=
DISP_E_MEMBERNOTFOUND
;
goto
cleanup
;
}
}
else
{
break
;
}
default:
hres
=
E_INVALIDARG
;
goto
cleanup
;
}
nsIDOMWindowCollection_Release
(
nsFrames
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
window
)
return
DISP_E_MEMBERNOTFOUND
;
IHTMLWindow2_AddRef
(
&
window
->
IHTMLWindow2_iface
);
V_VT
(
pvarResult
)
=
VT_DISPATCH
;
V_DISPATCH
(
pvarResult
)
=
(
IDispatch
*
)
window
;
hres
=
S_OK
;
cleanup:
nsIDOMWindowCollection_Release
(
nsFrames
);
return
hres
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLWindow2_get_length
(
IHTMLWindow2
*
iface
,
LONG
*
p
)
...
...
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