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
4c66a462
Commit
4c66a462
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: Improved helper for returning color as VARIANT in HTMLBodyElement implementation.
parent
81fcb109
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
htmlbody.c
dlls/mshtml/htmlbody.c
+18
-22
No files found.
dlls/mshtml/htmlbody.c
View file @
4c66a462
...
...
@@ -178,10 +178,16 @@ static BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr)
}
static
void
nscolor_to_variant
(
const
nsAString
*
nsstr
,
VARIANT
*
p
)
static
HRESULT
return_nscolor
(
nsresult
nsres
,
nsAString
*
nsstr
,
VARIANT
*
p
)
{
const
PRUnichar
*
color
;
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"failed: %08x
\n
"
,
nsres
);
nsAString_Finish
(
nsstr
);
return
E_FAIL
;
}
nsAString_GetData
(
nsstr
,
&
color
);
if
(
*
color
==
'#'
)
{
...
...
@@ -190,7 +196,15 @@ static void nscolor_to_variant(const nsAString *nsstr, VARIANT *p)
}
else
{
V_VT
(
p
)
=
VT_BSTR
;
V_BSTR
(
p
)
=
SysAllocString
(
color
);
if
(
!
V_BSTR
(
p
))
{
nsAString_Finish
(
nsstr
);
return
E_OUTOFMEMORY
;
}
}
nsAString_Finish
(
nsstr
);
TRACE
(
"ret %s
\n
"
,
debugstr_variant
(
p
));
return
S_OK
;
}
static
inline
HTMLBodyElement
*
impl_from_IHTMLBodyElement
(
IHTMLBodyElement
*
iface
)
...
...
@@ -502,13 +516,7 @@ static HRESULT WINAPI HTMLBodyElement_get_link(IHTMLBodyElement *iface, VARIANT
nsAString_Init
(
&
link_str
,
NULL
);
nsres
=
nsIDOMHTMLBodyElement_GetLink
(
This
->
nsbody
,
&
link_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetLink failed: %08x
\n
"
,
nsres
);
nscolor_to_variant
(
&
link_str
,
p
);
nsAString_Finish
(
&
link_str
);
return
S_OK
;
return
return_nscolor
(
nsres
,
&
link_str
,
p
);
}
static
HRESULT
WINAPI
HTMLBodyElement_put_vLink
(
IHTMLBodyElement
*
iface
,
VARIANT
v
)
...
...
@@ -540,13 +548,7 @@ static HRESULT WINAPI HTMLBodyElement_get_vLink(IHTMLBodyElement *iface, VARIANT
nsAString_Init
(
&
vlink_str
,
NULL
);
nsres
=
nsIDOMHTMLBodyElement_GetVLink
(
This
->
nsbody
,
&
vlink_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetLink failed: %08x
\n
"
,
nsres
);
nscolor_to_variant
(
&
vlink_str
,
p
);
nsAString_Finish
(
&
vlink_str
);
return
S_OK
;
return
return_nscolor
(
nsres
,
&
vlink_str
,
p
);
}
static
HRESULT
WINAPI
HTMLBodyElement_put_aLink
(
IHTMLBodyElement
*
iface
,
VARIANT
v
)
...
...
@@ -578,13 +580,7 @@ static HRESULT WINAPI HTMLBodyElement_get_aLink(IHTMLBodyElement *iface, VARIANT
nsAString_Init
(
&
alink_str
,
NULL
);
nsres
=
nsIDOMHTMLBodyElement_GetALink
(
This
->
nsbody
,
&
alink_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetALink failed: %08x
\n
"
,
nsres
);
nscolor_to_variant
(
&
alink_str
,
p
);
nsAString_Finish
(
&
alink_str
);
return
S_OK
;
return
return_nscolor
(
nsres
,
&
alink_str
,
p
);
}
static
HRESULT
WINAPI
HTMLBodyElement_put_onload
(
IHTMLBodyElement
*
iface
,
VARIANT
v
)
...
...
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