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
6b74a99d
Commit
6b74a99d
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: Pass style value as nsAString to set_nsstyle_property.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6ab3ed7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
htmlstyle.c
dlls/mshtml/htmlstyle.c
+14
-8
No files found.
dlls/mshtml/htmlstyle.c
View file @
6b74a99d
...
...
@@ -913,17 +913,15 @@ static LPWSTR fix_url_value(LPCWSTR val)
return
ret
;
}
static
HRESULT
set_nsstyle_property
(
nsIDOMCSSStyleDeclaration
*
nsstyle
,
styleid_t
sid
,
const
WCHAR
*
value
)
static
HRESULT
set_nsstyle_property
(
nsIDOMCSSStyleDeclaration
*
nsstyle
,
styleid_t
sid
,
const
nsAString
*
value
)
{
nsAString
str_name
,
str_
value
,
str_
empty
;
nsAString
str_name
,
str_empty
;
nsresult
nsres
;
nsAString_InitDepend
(
&
str_name
,
style_tbl
[
sid
].
name
);
nsAString_InitDepend
(
&
str_value
,
value
);
nsAString_InitDepend
(
&
str_empty
,
emptyW
);
nsres
=
nsIDOMCSSStyleDeclaration_SetProperty
(
nsstyle
,
&
str_name
,
&
str_
value
,
&
str_empty
);
nsres
=
nsIDOMCSSStyleDeclaration_SetProperty
(
nsstyle
,
&
str_name
,
value
,
&
str_empty
);
nsAString_Finish
(
&
str_name
);
nsAString_Finish
(
&
str_value
);
nsAString_Finish
(
&
str_empty
);
if
(
NS_FAILED
(
nsres
))
WARN
(
"SetProperty failed: %08x
\n
"
,
nsres
);
...
...
@@ -969,6 +967,7 @@ static HRESULT var_to_styleval(CSSStyle *style, const VARIANT *v, const style_tb
static
inline
HRESULT
set_style_property
(
CSSStyle
*
style
,
styleid_t
sid
,
const
WCHAR
*
value
)
{
nsAString
value_str
;
WCHAR
*
val
=
NULL
;
HRESULT
hres
;
...
...
@@ -983,7 +982,9 @@ static inline HRESULT set_style_property(CSSStyle *style, styleid_t sid, const W
}
if
(
!*
iter
)
{
WARN
(
"invalid value %s
\n
"
,
debugstr_w
(
value
));
set_nsstyle_property
(
style
->
nsstyle
,
sid
,
emptyW
);
nsAString_InitDepend
(
&
value_str
,
emptyW
);
set_nsstyle_property
(
style
->
nsstyle
,
sid
,
&
value_str
);
nsAString_Finish
(
&
value_str
);
return
E_INVALIDARG
;
}
}
...
...
@@ -994,7 +995,9 @@ static inline HRESULT set_style_property(CSSStyle *style, styleid_t sid, const W
val
=
fix_url_value
(
value
);
}
hres
=
set_nsstyle_property
(
style
->
nsstyle
,
sid
,
val
?
val
:
value
);
nsAString_InitDepend
(
&
value_str
,
val
?
val
:
value
);
hres
=
set_nsstyle_property
(
style
->
nsstyle
,
sid
,
&
value_str
);
nsAString_Finish
(
&
value_str
);
heap_free
(
val
);
return
hres
;
}
...
...
@@ -10291,13 +10294,16 @@ HRESULT get_elem_style(HTMLElement *elem, styleid_t styleid, BSTR *ret)
HRESULT
set_elem_style
(
HTMLElement
*
elem
,
styleid_t
styleid
,
const
WCHAR
*
val
)
{
nsIDOMCSSStyleDeclaration
*
style
;
nsAString
value_str
;
HRESULT
hres
;
hres
=
get_style_from_elem
(
elem
,
&
style
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
set_nsstyle_property
(
style
,
styleid
,
val
);
nsAString_InitDepend
(
&
value_str
,
val
);
hres
=
set_nsstyle_property
(
style
,
styleid
,
&
value_str
);
nsAString_Finish
(
&
value_str
);
nsIDOMCSSStyleDeclaration_Release
(
style
);
return
hres
;
}
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