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
2903090e
Commit
2903090e
authored
Nov 30, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/layout: Zero-initialize format structure.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2a74ed80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
42 deletions
+24
-42
layout.c
dlls/dwrite/layout.c
+24
-42
No files found.
dlls/dwrite/layout.c
View file @
2903090e
...
...
@@ -5920,10 +5920,10 @@ static struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWriteTextF
CONTAINING_RECORD
(
iface
,
struct
dwrite_textformat
,
IDWriteTextFormat3_iface
)
:
NULL
;
}
HRESULT
create_textformat
(
const
WCHAR
*
family_name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
FLOAT
size
,
const
WCHAR
*
locale
,
IDWriteTextFormat
**
format
)
HRESULT
create_textformat
(
const
WCHAR
*
family_name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
FLOAT
size
,
const
WCHAR
*
locale
,
IDWriteTextFormat
**
format
)
{
struct
dwrite_textformat
*
This
;
struct
dwrite_textformat
*
object
;
*
format
=
NULL
;
...
...
@@ -5935,45 +5935,27 @@ HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *colle
((
UINT32
)
style
>
DWRITE_FONT_STYLE_ITALIC
))
return
E_INVALIDARG
;
This
=
heap_alloc
(
sizeof
(
struct
dwrite_textformat
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IDWriteTextFormat3_iface
.
lpVtbl
=
&
dwritetextformatvtbl
;
This
->
refcount
=
1
;
This
->
format
.
family_name
=
heap_strdupW
(
family_name
);
This
->
format
.
family_len
=
strlenW
(
family_name
);
This
->
format
.
locale
=
heap_strdupW
(
locale
);
This
->
format
.
locale_len
=
strlenW
(
locale
);
/* force locale name to lower case, layout will inherit this modified value */
strlwrW
(
This
->
format
.
locale
);
This
->
format
.
weight
=
weight
;
This
->
format
.
style
=
style
;
This
->
format
.
fontsize
=
size
;
This
->
format
.
tabstop
=
4
.
0
f
*
size
;
This
->
format
.
stretch
=
stretch
;
This
->
format
.
textalignment
=
DWRITE_TEXT_ALIGNMENT_LEADING
;
This
->
format
.
optical_alignment
=
DWRITE_OPTICAL_ALIGNMENT_NONE
;
This
->
format
.
paralign
=
DWRITE_PARAGRAPH_ALIGNMENT_NEAR
;
This
->
format
.
wrapping
=
DWRITE_WORD_WRAPPING_WRAP
;
This
->
format
.
last_line_wrapping
=
TRUE
;
This
->
format
.
readingdir
=
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
;
This
->
format
.
flow
=
DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
;
This
->
format
.
spacing
.
method
=
DWRITE_LINE_SPACING_METHOD_DEFAULT
;
This
->
format
.
spacing
.
height
=
0
.
0
f
;
This
->
format
.
spacing
.
baseline
=
0
.
0
f
;
This
->
format
.
spacing
.
leadingBefore
=
0
.
0
f
;
This
->
format
.
spacing
.
fontLineGapUsage
=
DWRITE_FONT_LINE_GAP_USAGE_DEFAULT
;
This
->
format
.
vertical_orientation
=
DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT
;
This
->
format
.
trimming
.
granularity
=
DWRITE_TRIMMING_GRANULARITY_NONE
;
This
->
format
.
trimming
.
delimiter
=
0
;
This
->
format
.
trimming
.
delimiterCount
=
0
;
This
->
format
.
trimmingsign
=
NULL
;
This
->
format
.
collection
=
collection
;
This
->
format
.
fallback
=
NULL
;
This
->
format
.
automatic_axes
=
DWRITE_AUTOMATIC_FONT_AXES_NONE
;
IDWriteFontCollection_AddRef
(
collection
);
*
format
=
(
IDWriteTextFormat
*
)
&
This
->
IDWriteTextFormat3_iface
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IDWriteTextFormat3_iface
.
lpVtbl
=
&
dwritetextformatvtbl
;
object
->
refcount
=
1
;
object
->
format
.
family_name
=
heap_strdupW
(
family_name
);
object
->
format
.
family_len
=
strlenW
(
family_name
);
object
->
format
.
locale
=
heap_strdupW
(
locale
);
object
->
format
.
locale_len
=
strlenW
(
locale
);
/* Force locale name to lower case, layout will inherit this modified value. */
strlwrW
(
object
->
format
.
locale
);
object
->
format
.
weight
=
weight
;
object
->
format
.
style
=
style
;
object
->
format
.
fontsize
=
size
;
object
->
format
.
tabstop
=
4
.
0
f
*
size
;
object
->
format
.
stretch
=
stretch
;
object
->
format
.
last_line_wrapping
=
TRUE
;
object
->
format
.
collection
=
collection
;
IDWriteFontCollection_AddRef
(
object
->
format
.
collection
);
*
format
=
(
IDWriteTextFormat
*
)
&
object
->
IDWriteTextFormat3_iface
;
return
S_OK
;
}
...
...
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