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
15933644
Commit
15933644
authored
Apr 19, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Factor out variant_to_nsstr from var_to_styleval.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f0497aac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
33 deletions
+43
-33
htmlstyle.c
dlls/mshtml/htmlstyle.c
+4
-33
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+38
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
15933644
...
...
@@ -933,43 +933,14 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_
static
HRESULT
var_to_styleval
(
CSSStyle
*
style
,
VARIANT
*
v
,
const
style_tbl_entry_t
*
entry
,
nsAString
*
nsstr
)
{
HRESULT
hres
;
unsigned
flags
=
entry
&&
dispex_compat_mode
(
&
style
->
dispex
)
<
COMPAT_MODE_IE9
?
entry
->
flags
:
0
;
switch
(
V_VT
(
v
))
{
case
VT_NULL
:
nsAString_InitDepend
(
nsstr
,
NULL
);
return
S_OK
;
case
VT_BSTR
:
nsAString_InitDepend
(
nsstr
,
V_BSTR
(
v
));
break
;
case
VT_BSTR
|
VT_BYREF
:
nsAString_InitDepend
(
nsstr
,
*
V_BSTRREF
(
v
));
break
;
case
VT_I4
:
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
'd'
,
0
};
static
const
WCHAR
hex_formatW
[]
=
{
'#'
,
'%'
,
'0'
,
'6'
,
'x'
,
0
};
WCHAR
buf
[
14
];
if
(
flags
&
ATTR_HEX_INT
)
wsprintfW
(
buf
,
hex_formatW
,
V_I4
(
v
));
else
wsprintfW
(
buf
,
formatW
,
V_I4
(
v
));
nsAString_Init
(
nsstr
,
buf
);
break
;
}
default:
FIXME
(
"not implemented for %s
\n
"
,
debugstr_variant
(
v
));
return
E_NOTIMPL
;
}
if
(
flags
&
ATTR_FIX_PX
)
hres
=
variant_to_nsstr
(
v
,
!!
(
flags
&
ATTR_HEX_INT
),
nsstr
);
if
(
SUCCEEDED
(
hres
)
&&
(
flags
&
ATTR_FIX_PX
))
fix_px_value
(
nsstr
);
return
S_OK
;
return
hres
;
}
static
inline
HRESULT
set_style_property
(
CSSStyle
*
style
,
styleid_t
sid
,
const
WCHAR
*
value
)
...
...
dlls/mshtml/mshtml_private.h
View file @
15933644
...
...
@@ -975,6 +975,7 @@ void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN;
HRESULT
map_nsresult
(
nsresult
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr
(
nsresult
,
nsAString
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr_variant
(
nsresult
nsres
,
nsAString
*
nsstr
,
VARIANT
*
p
)
DECLSPEC_HIDDEN
;
HRESULT
variant_to_nsstr
(
VARIANT
*
,
BOOL
,
nsAString
*
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsform
(
nsresult
,
nsIDOMHTMLFormElement
*
,
IHTMLFormElement
**
)
DECLSPEC_HIDDEN
;
nsICommandParams
*
create_nscommand_params
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
15933644
...
...
@@ -932,6 +932,44 @@ HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, VARIANT *p)
return
S_OK
;
}
/*
* Converts VARIANT to string and stores the result in nsAString. To avoid useless
* allocations, the function uses an existing string if available, so caller must
* ensure that passed VARIANT is unchanged as long as its string representation is used
*/
HRESULT
variant_to_nsstr
(
VARIANT
*
v
,
BOOL
hex_int
,
nsAString
*
nsstr
)
{
WCHAR
buf
[
32
];
static
const
WCHAR
d_formatW
[]
=
{
'%'
,
'd'
,
0
};
static
const
WCHAR
hex_formatW
[]
=
{
'#'
,
'%'
,
'0'
,
'6'
,
'x'
,
0
};
switch
(
V_VT
(
v
))
{
case
VT_NULL
:
nsAString_InitDepend
(
nsstr
,
NULL
);
return
S_OK
;
case
VT_BSTR
:
nsAString_InitDepend
(
nsstr
,
V_BSTR
(
v
));
break
;
case
VT_BSTR
|
VT_BYREF
:
nsAString_InitDepend
(
nsstr
,
*
V_BSTRREF
(
v
));
break
;
case
VT_I4
:
wsprintfW
(
buf
,
hex_int
?
hex_formatW
:
d_formatW
,
V_I4
(
v
));
nsAString_Init
(
nsstr
,
buf
);
break
;
default:
FIXME
(
"not implemented for %s
\n
"
,
debugstr_variant
(
v
));
return
E_NOTIMPL
;
}
return
S_OK
;
}
nsICommandParams
*
create_nscommand_params
(
void
)
{
nsICommandParams
*
ret
=
NULL
;
...
...
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