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
16a5a5c9
Commit
16a5a5c9
authored
Apr 13, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use return_nsstr helper in more functions.
parent
29fbc702
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
201 deletions
+27
-201
htmlframebase.c
dlls/mshtml/htmlframebase.c
+7
-27
htmlimg.c
dlls/mshtml/htmlimg.c
+5
-25
htmlinput.c
dlls/mshtml/htmlinput.c
+2
-26
htmlnode.c
dlls/mshtml/htmlnode.c
+5
-21
htmloption.c
dlls/mshtml/htmloption.c
+2
-22
htmlscript.c
dlls/mshtml/htmlscript.c
+1
-9
htmlselect.c
dlls/mshtml/htmlselect.c
+2
-26
htmltextarea.c
dlls/mshtml/htmltextarea.c
+2
-26
htmlwindow.c
dlls/mshtml/htmlwindow.c
+1
-19
No files found.
dlls/mshtml/htmlframebase.c
View file @
16a5a5c9
...
...
@@ -155,41 +155,21 @@ static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase
*
This
=
impl_from_IHTMLFrameBase
(
iface
);
nsAString
nsstr
;
const
PRUnichar
*
strdata
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
nsframe
)
{
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLFrameElement_GetName
(
This
->
nsframe
,
&
nsstr
);
}
else
if
(
This
->
nsiframe
)
{
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLIFrameElement_GetName
(
This
->
nsiframe
,
&
nsstr
);
}
else
{
if
(
!
This
->
nsframe
&&
!
This
->
nsiframe
)
{
ERR
(
"No attached ns frame object
\n
"
);
return
E_UNEXPECTED
;
}
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetName failed: 0x%08x
\n
"
,
nsres
);
nsAString_Finish
(
&
nsstr
);
return
E_FAIL
;
}
nsAString_GetData
(
&
nsstr
,
&
strdata
);
if
(
*
strdata
)
{
*
p
=
SysAllocString
(
strdata
);
if
(
!*
p
)
{
nsAString_Finish
(
&
nsstr
);
return
E_OUTOFMEMORY
;
}
}
else
*
p
=
NULL
;
nsAString_Finish
(
&
nsstr
);
return
S_OK
;
nsAString_Init
(
&
nsstr
,
NULL
);
if
(
This
->
nsframe
)
nsres
=
nsIDOMHTMLFrameElement_GetName
(
This
->
nsframe
,
&
nsstr
);
else
nsres
=
nsIDOMHTMLIFrameElement_GetName
(
This
->
nsiframe
,
&
nsstr
);
return
return_nsstr
(
nsres
,
&
nsstr
,
p
);
}
static
HRESULT
WINAPI
HTMLFrameBase_put_border
(
IHTMLFrameBase
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/htmlimg.c
View file @
16a5a5c9
...
...
@@ -251,17 +251,7 @@ static HRESULT WINAPI HTMLImgElement_get_alt(IHTMLImgElement *iface, BSTR *p)
nsAString_Init
(
&
alt_str
,
NULL
);
nsres
=
nsIDOMHTMLImageElement_GetAlt
(
This
->
nsimg
,
&
alt_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
alt
;
nsAString_GetData
(
&
alt_str
,
&
alt
);
*
p
=
*
alt
?
SysAllocString
(
alt
)
:
NULL
;
}
else
{
ERR
(
"GetAlt failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
alt_str
);
return
NS_SUCCEEDED
(
nsres
)
?
S_OK
:
E_FAIL
;
return
return_nsstr
(
nsres
,
&
alt_str
,
p
);
}
static
HRESULT
WINAPI
HTMLImgElement_put_src
(
IHTMLImgElement
*
iface
,
BSTR
v
)
...
...
@@ -459,24 +449,14 @@ static HRESULT WINAPI HTMLImgElement_put_name(IHTMLImgElement *iface, BSTR v)
static
HRESULT
WINAPI
HTMLImgElement_get_name
(
IHTMLImgElement
*
iface
,
BSTR
*
p
)
{
HTMLImgElement
*
This
=
impl_from_IHTMLImgElement
(
iface
);
nsAString
strN
ame
;
nsAString
n
ame
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
strName
,
NULL
);
nsres
=
nsIDOMHTMLImageElement_GetName
(
This
->
nsimg
,
&
strName
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
str
;
nsAString_GetData
(
&
strName
,
&
str
);
*
p
=
*
str
?
SysAllocString
(
str
)
:
NULL
;
}
else
{
ERR
(
"GetName failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
strName
);
return
NS_SUCCEEDED
(
nsres
)
?
S_OK
:
E_FAIL
;
nsAString_Init
(
&
name
,
NULL
);
nsres
=
nsIDOMHTMLImageElement_GetName
(
This
->
nsimg
,
&
name
);
return
return_nsstr
(
nsres
,
&
name
,
p
);
}
static
HRESULT
WINAPI
HTMLImgElement_put_width
(
IHTMLImgElement
*
iface
,
LONG
v
)
...
...
dlls/mshtml/htmlinput.c
View file @
16a5a5c9
...
...
@@ -136,25 +136,13 @@ static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *
{
HTMLInputElement
*
This
=
impl_from_IHTMLInputElement
(
iface
);
nsAString
type_str
;
const
PRUnichar
*
type
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
type_str
,
NULL
);
nsres
=
nsIDOMHTMLInputElement_GetType
(
This
->
nsinput
,
&
type_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
type_str
,
&
type
);
*
p
=
SysAllocString
(
type
);
}
else
{
ERR
(
"GetType failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
type_str
);
TRACE
(
"type=%s
\n
"
,
debugstr_w
(
*
p
));
return
S_OK
;
return
return_nsstr
(
nsres
,
&
type_str
,
p
);
}
static
HRESULT
WINAPI
HTMLInputElement_put_value
(
IHTMLInputElement
*
iface
,
BSTR
v
)
...
...
@@ -210,25 +198,13 @@ static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *
{
HTMLInputElement
*
This
=
impl_from_IHTMLInputElement
(
iface
);
nsAString
name_str
;
const
PRUnichar
*
name
;
nsresult
nsres
;
HRESULT
hres
=
S_OK
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
name_str
,
NULL
);
nsres
=
nsIDOMHTMLInputElement_GetName
(
This
->
nsinput
,
&
name_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
name_str
,
&
name
);
*
p
=
*
name
?
SysAllocString
(
name
)
:
NULL
;
}
else
{
ERR
(
"GetName failed: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
name_str
);
return
hres
;
return
return_nsstr
(
nsres
,
&
name_str
,
p
);
}
static
HRESULT
WINAPI
HTMLInputElement_put_status
(
IHTMLInputElement
*
iface
,
VARIANT_BOOL
v
)
...
...
dlls/mshtml/htmlnode.c
View file @
16a5a5c9
...
...
@@ -697,30 +697,14 @@ static HRESULT WINAPI HTMLDOMNode_appendChild(IHTMLDOMNode *iface, IHTMLDOMNode
static
HRESULT
WINAPI
HTMLDOMNode_get_nodeName
(
IHTMLDOMNode
*
iface
,
BSTR
*
p
)
{
HTMLDOMNode
*
This
=
impl_from_IHTMLDOMNode
(
iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
*
p
=
NULL
;
if
(
This
->
nsnode
)
{
nsAString
name_str
;
const
PRUnichar
*
name
;
nsAString
name
;
nsresult
nsres
;
nsAString_Init
(
&
name_str
,
NULL
);
nsres
=
nsIDOMNode_GetNodeName
(
This
->
nsnode
,
&
name_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
name_str
,
&
name
);
*
p
=
SysAllocString
(
name
);
}
else
{
ERR
(
"GetNodeName failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
name_str
);
}
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
S_OK
;
nsAString_Init
(
&
name
,
NULL
);
nsres
=
nsIDOMNode_GetNodeName
(
This
->
nsnode
,
&
name
);
return
return_nsstr
(
nsres
,
&
name
,
p
);
}
static
HRESULT
WINAPI
HTMLDOMNode_put_nodeValue
(
IHTMLDOMNode
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/htmloption.c
View file @
16a5a5c9
...
...
@@ -153,23 +153,13 @@ static HRESULT WINAPI HTMLOptionElement_get_value(IHTMLOptionElement *iface, BST
{
HTMLOptionElement
*
This
=
impl_from_IHTMLOptionElement
(
iface
);
nsAString
value_str
;
const
PRUnichar
*
value
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
value_str
,
NULL
);
nsres
=
nsIDOMHTMLOptionElement_GetValue
(
This
->
nsoption
,
&
value_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
value_str
,
&
value
);
*
p
=
SysAllocString
(
value
);
}
else
{
ERR
(
"GetValue failed: %08x
\n
"
,
nsres
);
*
p
=
NULL
;
}
nsAString_Finish
(
&
value_str
);
return
S_OK
;
return
return_nsstr
(
nsres
,
&
value_str
,
p
);
}
static
HRESULT
WINAPI
HTMLOptionElement_put_defaultSelected
(
IHTMLOptionElement
*
iface
,
VARIANT_BOOL
v
)
...
...
@@ -253,23 +243,13 @@ static HRESULT WINAPI HTMLOptionElement_get_text(IHTMLOptionElement *iface, BSTR
{
HTMLOptionElement
*
This
=
impl_from_IHTMLOptionElement
(
iface
);
nsAString
text_str
;
const
PRUnichar
*
text
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
text_str
,
NULL
);
nsres
=
nsIDOMHTMLOptionElement_GetText
(
This
->
nsoption
,
&
text_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
text_str
,
&
text
);
*
p
=
SysAllocString
(
text
);
}
else
{
ERR
(
"GetText failed: %08x
\n
"
,
nsres
);
*
p
=
NULL
;
}
nsAString_Finish
(
&
text_str
);
return
S_OK
;
return
return_nsstr
(
nsres
,
&
text_str
,
p
);
}
static
HRESULT
WINAPI
HTMLOptionElement_get_form
(
IHTMLOptionElement
*
iface
,
IHTMLFormElement
**
p
)
...
...
dlls/mshtml/htmlscript.c
View file @
16a5a5c9
...
...
@@ -240,7 +240,6 @@ static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR
static
HRESULT
WINAPI
HTMLScriptElement_get_type
(
IHTMLScriptElement
*
iface
,
BSTR
*
p
)
{
HTMLScriptElement
*
This
=
impl_from_IHTMLScriptElement
(
iface
);
const
PRUnichar
*
nstype
;
nsAString
nstype_str
;
nsresult
nsres
;
...
...
@@ -248,14 +247,7 @@ static HRESULT WINAPI HTMLScriptElement_get_type(IHTMLScriptElement *iface, BSTR
nsAString_Init
(
&
nstype_str
,
NULL
);
nsres
=
nsIDOMHTMLScriptElement_GetType
(
This
->
nsscript
,
&
nstype_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetType failed: %08x
\n
"
,
nsres
);
nsAString_GetData
(
&
nstype_str
,
&
nstype
);
*
p
=
*
nstype
?
SysAllocString
(
nstype
)
:
NULL
;
nsAString_Finish
(
&
nstype_str
);
return
S_OK
;
return
return_nsstr
(
nsres
,
&
nstype_str
,
p
);
}
static
const
IHTMLScriptElementVtbl
HTMLScriptElementVtbl
=
{
...
...
dlls/mshtml/htmlselect.c
View file @
16a5a5c9
...
...
@@ -266,26 +266,14 @@ static HRESULT WINAPI HTMLSelectElement_get_selectedIndex(IHTMLSelectElement *if
static
HRESULT
WINAPI
HTMLSelectElement_get_type
(
IHTMLSelectElement
*
iface
,
BSTR
*
p
)
{
HTMLSelectElement
*
This
=
impl_from_IHTMLSelectElement
(
iface
);
const
PRUnichar
*
type
;
nsAString
type_str
;
nsresult
nsres
;
HRESULT
hres
=
S_OK
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
type_str
,
NULL
);
nsres
=
nsIDOMHTMLSelectElement_GetType
(
This
->
nsselect
,
&
type_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
type_str
,
&
type
);
*
p
=
*
type
?
SysAllocString
(
type
)
:
NULL
;
}
else
{
ERR
(
"GetType failed: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
type_str
);
return
hres
;
return
return_nsstr
(
nsres
,
&
type_str
,
p
);
}
static
HRESULT
WINAPI
HTMLSelectElement_put_value
(
IHTMLSelectElement
*
iface
,
BSTR
v
)
...
...
@@ -309,25 +297,13 @@ static HRESULT WINAPI HTMLSelectElement_get_value(IHTMLSelectElement *iface, BST
{
HTMLSelectElement
*
This
=
impl_from_IHTMLSelectElement
(
iface
);
nsAString
value_str
;
const
PRUnichar
*
value
=
NULL
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
value_str
,
NULL
);
nsres
=
nsIDOMHTMLSelectElement_GetValue
(
This
->
nsselect
,
&
value_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
value_str
,
&
value
);
*
p
=
*
value
?
SysAllocString
(
value
)
:
NULL
;
}
else
{
ERR
(
"GetValue failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
value_str
);
TRACE
(
"value=%s
\n
"
,
debugstr_w
(
*
p
));
return
S_OK
;
return
return_nsstr
(
nsres
,
&
value_str
,
p
);
}
static
HRESULT
WINAPI
HTMLSelectElement_put_disabled
(
IHTMLSelectElement
*
iface
,
VARIANT_BOOL
v
)
...
...
dlls/mshtml/htmltextarea.c
View file @
16a5a5c9
...
...
@@ -135,25 +135,13 @@ static HRESULT WINAPI HTMLTextAreaElement_get_value(IHTMLTextAreaElement *iface,
{
HTMLTextAreaElement
*
This
=
impl_from_IHTMLTextAreaElement
(
iface
);
nsAString
value_str
;
const
PRUnichar
*
value
;
nsresult
nsres
;
HRESULT
hres
=
S_OK
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
value_str
,
NULL
);
nsres
=
nsIDOMHTMLTextAreaElement_GetValue
(
This
->
nstextarea
,
&
value_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
value_str
,
&
value
);
*
p
=
*
value
?
SysAllocString
(
value
)
:
NULL
;
}
else
{
ERR
(
"GetValue failed: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
value_str
);
return
hres
;
return
return_nsstr
(
nsres
,
&
value_str
,
p
);
}
static
HRESULT
WINAPI
HTMLTextAreaElement_put_name
(
IHTMLTextAreaElement
*
iface
,
BSTR
v
)
...
...
@@ -167,25 +155,13 @@ static HRESULT WINAPI HTMLTextAreaElement_get_name(IHTMLTextAreaElement *iface,
{
HTMLTextAreaElement
*
This
=
impl_from_IHTMLTextAreaElement
(
iface
);
nsAString
name_str
;
const
PRUnichar
*
name
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
name_str
,
NULL
);
nsres
=
nsIDOMHTMLTextAreaElement_GetName
(
This
->
nstextarea
,
&
name_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsAString_GetData
(
&
name_str
,
&
name
);
*
p
=
SysAllocString
(
name
);
}
else
{
ERR
(
"GetName failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
name_str
);
TRACE
(
"%s
\n
"
,
debugstr_w
(
*
p
));
return
S_OK
;
return
return_nsstr
(
nsres
,
&
name_str
,
p
);
}
static
HRESULT
WINAPI
HTMLTextAreaElement_put_status
(
IHTMLTextAreaElement
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/htmlwindow.c
View file @
16a5a5c9
...
...
@@ -750,30 +750,12 @@ static HRESULT WINAPI HTMLWindow2_get_name(IHTMLWindow2 *iface, BSTR *p)
HTMLWindow
*
This
=
impl_from_IHTMLWindow2
(
iface
);
nsAString
name_str
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
name_str
,
NULL
);
nsres
=
nsIDOMWindow_GetName
(
This
->
nswindow
,
&
name_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
name
;
nsAString_GetData
(
&
name_str
,
&
name
);
if
(
*
name
)
{
*
p
=
SysAllocString
(
name
);
hres
=
*
p
?
S_OK
:
E_OUTOFMEMORY
;
}
else
{
*
p
=
NULL
;
hres
=
S_OK
;
}
}
else
{
ERR
(
"GetName failed: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
name_str
);
return
hres
;
return
return_nsstr
(
nsres
,
&
name_str
,
p
);
}
static
HRESULT
WINAPI
HTMLWindow2_get_parent
(
IHTMLWindow2
*
iface
,
IHTMLWindow2
**
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