Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
a420b5da
Commit
a420b5da
authored
12 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mshtml: Simplify get_node_obj.
parent
60c9069f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/mshtml/htmlnode.c
+24
-13
24 additions, 13 deletions
dlls/mshtml/htmlnode.c
with
24 additions
and
13 deletions
dlls/mshtml/htmlnode.c
+
24
−
13
View file @
a420b5da
...
...
@@ -33,7 +33,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
static
HTMLDOMNode
*
get_node_obj
(
HTMLD
ocumentNode
*
,
IUnknown
*
);
static
HTMLDOMNode
*
get_node_obj
(
I
HTMLD
OMNode
*
);
static
HRESULT
create_node
(
HTMLDocumentNode
*
,
nsIDOMNode
*
,
HTMLDOMNode
**
);
typedef
struct
{
...
...
@@ -503,7 +503,7 @@ static HRESULT WINAPI HTMLDOMNode_insertBefore(IHTMLDOMNode *iface, IHTMLDOMNode
TRACE
(
"(%p)->(%p %s %p)
\n
"
,
This
,
newChild
,
debugstr_variant
(
&
refChild
),
node
);
new_child
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
newChild
);
new_child
=
get_node_obj
(
newChild
);
if
(
!
new_child
)
{
ERR
(
"invalid newChild
\n
"
);
return
E_INVALIDARG
;
...
...
@@ -513,9 +513,17 @@ static HRESULT WINAPI HTMLDOMNode_insertBefore(IHTMLDOMNode *iface, IHTMLDOMNode
case
VT_NULL
:
break
;
case
VT_DISPATCH
:
{
IHTMLDOMNode
*
ref_iface
;
if
(
!
V_DISPATCH
(
&
refChild
))
break
;
ref_node
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
V_DISPATCH
(
&
refChild
));
hres
=
IDispatch_QueryInterface
(
V_DISPATCH
(
&
refChild
),
&
IID_IHTMLDOMNode
,
(
void
**
)
&
ref_iface
);
if
(
FAILED
(
hres
))
break
;
ref_node
=
get_node_obj
(
ref_iface
);
IHTMLDOMNode_Release
(
ref_iface
);
if
(
!
ref_node
)
{
ERR
(
"unvalid node
\n
"
);
hres
=
E_FAIL
;
...
...
@@ -561,7 +569,7 @@ static HRESULT WINAPI HTMLDOMNode_removeChild(IHTMLDOMNode *iface, IHTMLDOMNode
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
oldChild
,
node
);
node_obj
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
oldChild
);
node_obj
=
get_node_obj
(
oldChild
);
if
(
!
node_obj
)
return
E_FAIL
;
...
...
@@ -593,11 +601,11 @@ static HRESULT WINAPI HTMLDOMNode_replaceChild(IHTMLDOMNode *iface, IHTMLDOMNode
TRACE
(
"(%p)->(%p %p %p)
\n
"
,
This
,
newChild
,
oldChild
,
node
);
node_new
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
newChild
);
node_new
=
get_node_obj
(
newChild
);
if
(
!
node_new
)
return
E_FAIL
;
node_old
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
oldChild
);
node_old
=
get_node_obj
(
oldChild
);
if
(
!
node_old
)
{
node_release
(
node_new
);
return
E_FAIL
;
...
...
@@ -678,7 +686,7 @@ static HRESULT WINAPI HTMLDOMNode_appendChild(IHTMLDOMNode *iface, IHTMLDOMNode
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
newChild
,
node
);
node_obj
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
newChild
);
node_obj
=
get_node_obj
(
newChild
);
if
(
!
node_obj
)
return
E_FAIL
;
...
...
@@ -886,13 +894,16 @@ static const IHTMLDOMNodeVtbl HTMLDOMNodeVtbl = {
HTMLDOMNode_get_nextSibling
};
static
HTMLDOMNode
*
get_node_obj
(
HTMLD
ocumentNode
*
This
,
IUnknown
*
iface
)
static
HTMLDOMNode
*
get_node_obj
(
I
HTMLD
OMNode
*
iface
)
{
IHTMLDOMNode
*
node
;
HRESULT
hres
;
HTMLDOMNode
*
ret
;
if
(
iface
->
lpVtbl
!=
&
HTMLDOMNodeVtbl
)
return
NULL
;
hres
=
IUnknown_QueryInterface
(
iface
,
&
IID_IHTMLDOMNode
,
(
void
**
)
&
node
);
return
hres
==
S_OK
&&
node
->
lpVtbl
==
&
HTMLDOMNodeVtbl
?
impl_from_IHTMLDOMNode
(
node
)
:
NULL
;
ret
=
impl_from_IHTMLDOMNode
(
iface
);
node_addref
(
ret
);
return
ret
;
}
static
inline
HTMLDOMNode
*
impl_from_IHTMLDOMNode2
(
IHTMLDOMNode2
*
iface
)
...
...
@@ -1192,7 +1203,7 @@ HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDO
assert
(
nsres
==
NS_OK
);
if
(
unk
)
{
*
ret
=
get_node_obj
(
This
,
(
IUnknown
*
)
unk
);
*
ret
=
get_node_obj
(
(
IHTMLDOMNode
*
)
unk
);
return
NS_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment