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
983774e3
Commit
983774e3
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: Use nsAString in fix_px_value.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6b74a99d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
htmlstyle.c
dlls/mshtml/htmlstyle.c
+13
-9
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+5
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
983774e3
...
@@ -858,9 +858,12 @@ static const style_tbl_entry_t *lookup_style_tbl(const WCHAR *name)
...
@@ -858,9 +858,12 @@ static const style_tbl_entry_t *lookup_style_tbl(const WCHAR *name)
return
NULL
;
return
NULL
;
}
}
static
LPWSTR
fix_px_value
(
LPCWSTR
val
)
static
void
fix_px_value
(
nsAString
*
nsstr
)
{
{
LPCWSTR
ptr
=
val
;
const
WCHAR
*
val
,
*
ptr
;
nsAString_GetData
(
nsstr
,
&
val
);
ptr
=
val
;
while
(
*
ptr
)
{
while
(
*
ptr
)
{
while
(
*
ptr
&&
isspaceW
(
*
ptr
))
while
(
*
ptr
&&
isspaceW
(
*
ptr
))
...
@@ -884,14 +887,14 @@ static LPWSTR fix_px_value(LPCWSTR val)
...
@@ -884,14 +887,14 @@ static LPWSTR fix_px_value(LPCWSTR val)
TRACE
(
"fixed %s -> %s
\n
"
,
debugstr_w
(
val
),
debugstr_w
(
ret
));
TRACE
(
"fixed %s -> %s
\n
"
,
debugstr_w
(
val
),
debugstr_w
(
ret
));
return
ret
;
nsAString_SetData
(
nsstr
,
ret
);
heap_free
(
ret
);
break
;
}
}
while
(
*
ptr
&&
!
isspaceW
(
*
ptr
))
while
(
*
ptr
&&
!
isspaceW
(
*
ptr
))
ptr
++
;
ptr
++
;
}
}
return
NULL
;
}
}
static
LPWSTR
fix_url_value
(
LPCWSTR
val
)
static
LPWSTR
fix_url_value
(
LPCWSTR
val
)
...
@@ -968,11 +971,12 @@ static HRESULT var_to_styleval(CSSStyle *style, const VARIANT *v, const style_tb
...
@@ -968,11 +971,12 @@ 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
)
static
inline
HRESULT
set_style_property
(
CSSStyle
*
style
,
styleid_t
sid
,
const
WCHAR
*
value
)
{
{
nsAString
value_str
;
nsAString
value_str
;
unsigned
flags
=
0
;
WCHAR
*
val
=
NULL
;
WCHAR
*
val
=
NULL
;
HRESULT
hres
;
HRESULT
hres
;
if
(
value
&&
*
value
&&
dispex_compat_mode
(
&
style
->
dispex
)
<
COMPAT_MODE_IE9
)
{
if
(
value
&&
*
value
&&
dispex_compat_mode
(
&
style
->
dispex
)
<
COMPAT_MODE_IE9
)
{
unsigned
flags
=
style_tbl
[
sid
].
flags
;
flags
=
style_tbl
[
sid
].
flags
;
if
(
style_tbl
[
sid
].
allowed_values
)
{
if
(
style_tbl
[
sid
].
allowed_values
)
{
const
WCHAR
**
iter
;
const
WCHAR
**
iter
;
...
@@ -989,13 +993,13 @@ static inline HRESULT set_style_property(CSSStyle *style, styleid_t sid, const W
...
@@ -989,13 +993,13 @@ static inline HRESULT set_style_property(CSSStyle *style, styleid_t sid, const W
}
}
}
}
if
(
flags
&
ATTR_FIX_PX
)
if
(
flags
&
ATTR_FIX_URL
)
val
=
fix_px_value
(
value
);
else
if
(
flags
&
ATTR_FIX_URL
)
val
=
fix_url_value
(
value
);
val
=
fix_url_value
(
value
);
}
}
nsAString_InitDepend
(
&
value_str
,
val
?
val
:
value
);
nsAString_InitDepend
(
&
value_str
,
val
?
val
:
value
);
if
(
flags
&
ATTR_FIX_PX
)
fix_px_value
(
&
value_str
);
hres
=
set_nsstyle_property
(
style
->
nsstyle
,
sid
,
&
value_str
);
hres
=
set_nsstyle_property
(
style
->
nsstyle
,
sid
,
&
value_str
);
nsAString_Finish
(
&
value_str
);
nsAString_Finish
(
&
value_str
);
heap_free
(
val
);
heap_free
(
val
);
...
...
dlls/mshtml/mshtml_private.h
View file @
983774e3
...
@@ -968,6 +968,7 @@ void nsACString_Finish(nsACString*) DECLSPEC_HIDDEN;
...
@@ -968,6 +968,7 @@ void nsACString_Finish(nsACString*) DECLSPEC_HIDDEN;
BOOL
nsAString_Init
(
nsAString
*
,
const
PRUnichar
*
)
DECLSPEC_HIDDEN
;
BOOL
nsAString_Init
(
nsAString
*
,
const
PRUnichar
*
)
DECLSPEC_HIDDEN
;
void
nsAString_InitDepend
(
nsAString
*
,
const
PRUnichar
*
)
DECLSPEC_HIDDEN
;
void
nsAString_InitDepend
(
nsAString
*
,
const
PRUnichar
*
)
DECLSPEC_HIDDEN
;
void
nsAString_SetData
(
nsAString
*
,
const
PRUnichar
*
)
DECLSPEC_HIDDEN
;
UINT32
nsAString_GetData
(
const
nsAString
*
,
const
PRUnichar
**
)
DECLSPEC_HIDDEN
;
UINT32
nsAString_GetData
(
const
nsAString
*
,
const
PRUnichar
**
)
DECLSPEC_HIDDEN
;
void
nsAString_Finish
(
nsAString
*
)
DECLSPEC_HIDDEN
;
void
nsAString_Finish
(
nsAString
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
983774e3
...
@@ -843,6 +843,11 @@ UINT32 nsAString_GetData(const nsAString *str, const PRUnichar **data)
...
@@ -843,6 +843,11 @@ UINT32 nsAString_GetData(const nsAString *str, const PRUnichar **data)
return
NS_StringGetData
(
str
,
data
,
NULL
);
return
NS_StringGetData
(
str
,
data
,
NULL
);
}
}
void
nsAString_SetData
(
nsAString
*
str
,
const
PRUnichar
*
data
)
{
NS_StringSetData
(
str
,
data
,
PR_UINT32_MAX
);
}
void
nsAString_Finish
(
nsAString
*
str
)
void
nsAString_Finish
(
nsAString
*
str
)
{
{
NS_StringContainerFinish
(
str
);
NS_StringContainerFinish
(
str
);
...
...
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