Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7f465761
Commit
7f465761
authored
Jun 05, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use return_nsstr_variant in IHTMLBodyElement::get_bgColor.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2e767e81
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
26 deletions
+18
-26
htmlbody.c
dlls/mshtml/htmlbody.c
+4
-17
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+13
-9
No files found.
dlls/mshtml/htmlbody.c
View file @
7f465761
...
...
@@ -407,27 +407,14 @@ static HRESULT WINAPI HTMLBodyElement_put_bgColor(IHTMLBodyElement *iface, VARIA
static
HRESULT
WINAPI
HTMLBodyElement_get_bgColor
(
IHTMLBodyElement
*
iface
,
VARIANT
*
p
)
{
HTMLBodyElement
*
This
=
impl_from_IHTMLBodyElement
(
iface
);
nsAString
strColo
r
;
nsAString
nsst
r
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
strColor
,
NULL
);
nsres
=
nsIDOMHTMLBodyElement_GetBgColor
(
This
->
nsbody
,
&
strColor
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
color
;
nsAString_GetData
(
&
strColor
,
&
color
);
V_VT
(
p
)
=
VT_BSTR
;
hres
=
nscolor_to_str
(
color
,
&
V_BSTR
(
p
));
}
else
{
ERR
(
"SetBgColor failed: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
strColor
);
return
hres
;
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLBodyElement_GetBgColor
(
This
->
nsbody
,
&
nsstr
);
return
return_nsstr_variant
(
nsres
,
&
nsstr
,
NSSTR_COLOR
,
p
);
}
static
HRESULT
WINAPI
HTMLBodyElement_put_text
(
IHTMLBodyElement
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
7f465761
...
...
@@ -982,6 +982,7 @@ UINT32 nsAString_GetData(const nsAString*,const PRUnichar**) DECLSPEC_HIDDEN;
void
nsAString_Finish
(
nsAString
*
)
DECLSPEC_HIDDEN
;
#define NSSTR_IMPLICIT_PX 0x01
#define NSSTR_COLOR 0x02
HRESULT
map_nsresult
(
nsresult
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr
(
nsresult
,
nsAString
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
7f465761
...
...
@@ -964,14 +964,15 @@ HRESULT return_nsstr(nsresult nsres, nsAString *nsstr, BSTR *p)
HRESULT
return_nsstr_variant
(
nsresult
nsres
,
nsAString
*
nsstr
,
unsigned
flags
,
VARIANT
*
p
)
{
HRESULT
hres
=
S_OK
;
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"failed: %08x
\n
"
,
nsres
);
nsAString_Finish
(
nsstr
);
return
E_FAIL
;
return
map_nsresult
(
nsres
)
;
}
if
(
NS_StringGetIsVoid
(
nsstr
))
{
TRACE
(
"ret null
\n
"
);
V_VT
(
p
)
=
VT_NULL
;
}
else
{
const
WCHAR
*
str
;
...
...
@@ -989,20 +990,23 @@ HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, unsigned flags, V
if
(
iter
==
str
+
len
&&
dot
)
len
=
dot
-
str
;
}
}
TRACE
(
"ret %s
\n
"
,
debugstr_wn
(
str
,
len
));
if
(
*
str
)
{
if
(
flags
&
NSSTR_COLOR
)
{
hres
=
nscolor_to_str
(
str
,
&
V_BSTR
(
p
));
}
else
if
(
*
str
)
{
V_BSTR
(
p
)
=
SysAllocStringLen
(
str
,
len
);
if
(
!
V_BSTR
(
p
))
{
nsAString_Finish
(
nsstr
);
return
E_OUTOFMEMORY
;
}
if
(
!
V_BSTR
(
p
))
hres
=
E_OUTOFMEMORY
;
}
else
{
V_BSTR
(
p
)
=
NULL
;
}
V_VT
(
p
)
=
VT_BSTR
;
if
(
SUCCEEDED
(
hres
))
V_VT
(
p
)
=
VT_BSTR
;
}
nsAString_Finish
(
nsstr
);
if
(
FAILED
(
hres
))
return
hres
;
TRACE
(
"ret %s
\n
"
,
debugstr_variant
(
p
));
return
S_OK
;
}
...
...
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