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
35a91741
Commit
35a91741
authored
Jan 03, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Move range bounds check to an attribute setting helper.
parent
48d84eed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
36 deletions
+3
-36
layout.c
dlls/dwrite/layout.c
+3
-36
No files found.
dlls/dwrite/layout.c
View file @
35a91741
...
...
@@ -639,6 +639,9 @@ static HRESULT set_layout_range_attr(struct dwrite_textlayout *layout, enum layo
BOOL
changed
=
FALSE
;
DWRITE_TEXT_RANGE
r
;
if
(
!
validate_text_range
(
layout
,
&
value
->
range
))
return
S_OK
;
/* If new range is completely within existing range, split existing range in two */
if
((
outer
=
find_outer_range
(
layout
,
&
value
->
range
)))
{
...
...
@@ -1097,9 +1100,6 @@ static HRESULT WINAPI dwritetextlayout_SetFontCollection(IDWriteTextLayout2 *ifa
TRACE
(
"(%p)->(%p %s)
\n
"
,
This
,
collection
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
collection
=
collection
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_FONTCOLL
,
&
value
);
...
...
@@ -1115,12 +1115,8 @@ static HRESULT WINAPI dwritetextlayout_SetFontFamilyName(IDWriteTextLayout2 *ifa
if
(
!
name
)
return
E_INVALIDARG
;
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
fontfamily
=
name
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_FONTFAMILY
,
&
value
);
}
...
...
@@ -1131,9 +1127,6 @@ static HRESULT WINAPI dwritetextlayout_SetFontWeight(IDWriteTextLayout2 *iface,
TRACE
(
"(%p)->(%d %s)
\n
"
,
This
,
weight
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
weight
=
weight
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_WEIGHT
,
&
value
);
...
...
@@ -1146,9 +1139,6 @@ static HRESULT WINAPI dwritetextlayout_SetFontStyle(IDWriteTextLayout2 *iface, D
TRACE
(
"(%p)->(%d %s)
\n
"
,
This
,
style
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
style
=
style
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_STYLE
,
&
value
);
...
...
@@ -1161,9 +1151,6 @@ static HRESULT WINAPI dwritetextlayout_SetFontStretch(IDWriteTextLayout2 *iface,
TRACE
(
"(%p)->(%d %s)
\n
"
,
This
,
stretch
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
stretch
=
stretch
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_STRETCH
,
&
value
);
...
...
@@ -1176,9 +1163,6 @@ static HRESULT WINAPI dwritetextlayout_SetFontSize(IDWriteTextLayout2 *iface, FL
TRACE
(
"(%p)->(%.2f %s)
\n
"
,
This
,
size
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
fontsize
=
size
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_FONTSIZE
,
&
value
);
...
...
@@ -1191,9 +1175,6 @@ static HRESULT WINAPI dwritetextlayout_SetUnderline(IDWriteTextLayout2 *iface, B
TRACE
(
"(%p)->(%d %s)
\n
"
,
This
,
underline
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
underline
=
underline
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_UNDERLINE
,
&
value
);
...
...
@@ -1206,9 +1187,6 @@ static HRESULT WINAPI dwritetextlayout_SetStrikethrough(IDWriteTextLayout2 *ifac
TRACE
(
"(%p)->(%d %s)
\n
"
,
This
,
strikethrough
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
underline
=
strikethrough
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_STRIKETHROUGH
,
&
value
);
...
...
@@ -1221,9 +1199,6 @@ static HRESULT WINAPI dwritetextlayout_SetDrawingEffect(IDWriteTextLayout2 *ifac
TRACE
(
"(%p)->(%p %s)
\n
"
,
This
,
effect
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
effect
=
effect
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_EFFECT
,
&
value
);
...
...
@@ -1236,12 +1211,8 @@ static HRESULT WINAPI dwritetextlayout_SetInlineObject(IDWriteTextLayout2 *iface
TRACE
(
"(%p)->(%p %s)
\n
"
,
This
,
object
,
debugstr_range
(
&
range
));
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
object
=
object
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_INLINE
,
&
value
);
}
...
...
@@ -1262,12 +1233,8 @@ static HRESULT WINAPI dwritetextlayout_SetLocaleName(IDWriteTextLayout2 *iface,
if
(
!
locale
||
strlenW
(
locale
)
>
LOCALE_NAME_MAX_LENGTH
-
1
)
return
E_INVALIDARG
;
if
(
!
validate_text_range
(
This
,
&
range
))
return
S_OK
;
value
.
range
=
range
;
value
.
u
.
locale
=
locale
;
return
set_layout_range_attr
(
This
,
LAYOUT_RANGE_ATTR_LOCALE
,
&
value
);
}
...
...
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