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
6706ada9
Commit
6706ada9
authored
Oct 27, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use API-defined type for family count.
parent
6128e73f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
font.c
dlls/dwrite/font.c
+19
-19
No files found.
dlls/dwrite/font.c
View file @
6706ada9
...
@@ -71,8 +71,8 @@ struct dwrite_fontcollection {
...
@@ -71,8 +71,8 @@ struct dwrite_fontcollection {
int
alloc
;
int
alloc
;
struct
dwrite_fontfamily_data
**
family_data
;
struct
dwrite_fontfamily_data
**
family_data
;
DWORD
data
_count
;
UINT32
family
_count
;
int
data
_alloc
;
UINT32
family
_alloc
;
};
};
struct
dwrite_fontfamily
{
struct
dwrite_fontfamily
{
...
@@ -1304,7 +1304,7 @@ static ULONG WINAPI dwritefontcollection_Release(IDWriteFontCollection *iface)
...
@@ -1304,7 +1304,7 @@ static ULONG WINAPI dwritefontcollection_Release(IDWriteFontCollection *iface)
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
heap_free
(
This
->
families
[
i
]);
heap_free
(
This
->
families
[
i
]);
heap_free
(
This
->
families
);
heap_free
(
This
->
families
);
for
(
i
=
0
;
i
<
This
->
data
_count
;
i
++
)
for
(
i
=
0
;
i
<
This
->
family
_count
;
i
++
)
_free_fontfamily_data
(
This
->
family_data
[
i
]);
_free_fontfamily_data
(
This
->
family_data
[
i
]);
heap_free
(
This
->
family_data
);
heap_free
(
This
->
family_data
);
heap_free
(
This
);
heap_free
(
This
);
...
@@ -1317,8 +1317,8 @@ static UINT32 WINAPI dwritefontcollection_GetFontFamilyCount(IDWriteFontCollecti
...
@@ -1317,8 +1317,8 @@ static UINT32 WINAPI dwritefontcollection_GetFontFamilyCount(IDWriteFontCollecti
{
{
struct
dwrite_fontcollection
*
This
=
impl_from_IDWriteFontCollection
(
iface
);
struct
dwrite_fontcollection
*
This
=
impl_from_IDWriteFontCollection
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
data
_count
)
if
(
This
->
family
_count
)
return
This
->
data
_count
;
return
This
->
family
_count
;
return
This
->
count
;
return
This
->
count
;
}
}
...
@@ -1331,9 +1331,9 @@ static HRESULT WINAPI dwritefontcollection_GetFontFamily(IDWriteFontCollection *
...
@@ -1331,9 +1331,9 @@ static HRESULT WINAPI dwritefontcollection_GetFontFamily(IDWriteFontCollection *
TRACE
(
"(%p)->(%u %p)
\n
"
,
This
,
index
,
family
);
TRACE
(
"(%p)->(%u %p)
\n
"
,
This
,
index
,
family
);
if
(
This
->
data
_count
)
if
(
This
->
family
_count
)
{
{
if
(
index
>=
This
->
data
_count
)
if
(
index
>=
This
->
family
_count
)
{
{
*
family
=
NULL
;
*
family
=
NULL
;
return
E_FAIL
;
return
E_FAIL
;
...
@@ -1362,8 +1362,8 @@ static HRESULT collection_find_family(struct dwrite_fontcollection *collection,
...
@@ -1362,8 +1362,8 @@ static HRESULT collection_find_family(struct dwrite_fontcollection *collection,
{
{
UINT32
i
;
UINT32
i
;
if
(
collection
->
data
_count
)
{
if
(
collection
->
family
_count
)
{
for
(
i
=
0
;
i
<
collection
->
data
_count
;
i
++
)
{
for
(
i
=
0
;
i
<
collection
->
family
_count
;
i
++
)
{
IDWriteLocalizedStrings
*
family_name
=
collection
->
family_data
[
i
]
->
familyname
;
IDWriteLocalizedStrings
*
family_name
=
collection
->
family_data
[
i
]
->
familyname
;
HRESULT
hr
;
HRESULT
hr
;
int
j
;
int
j
;
...
@@ -1421,7 +1421,7 @@ static HRESULT WINAPI dwritefontcollection_GetFontFromFontFace(IDWriteFontCollec
...
@@ -1421,7 +1421,7 @@ static HRESULT WINAPI dwritefontcollection_GetFontFromFontFace(IDWriteFontCollec
if
(
!
face
)
if
(
!
face
)
return
E_INVALIDARG
;
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
This
->
data
_count
;
i
++
)
{
for
(
i
=
0
;
i
<
This
->
family
_count
;
i
++
)
{
struct
dwrite_fontfamily_data
*
family_data
=
This
->
family_data
[
i
];
struct
dwrite_fontfamily_data
*
family_data
=
This
->
family_data
[
i
];
for
(
j
=
0
;
j
<
family_data
->
font_count
;
j
++
)
{
for
(
j
=
0
;
j
<
family_data
->
font_count
;
j
++
)
{
if
((
IDWriteFontFace
*
)
family_data
->
fonts
[
j
]
->
face
==
face
)
{
if
((
IDWriteFontFace
*
)
family_data
->
fonts
[
j
]
->
face
==
face
)
{
...
@@ -1494,21 +1494,21 @@ static HRESULT fontfamily_add_font(struct dwrite_fontfamily_data *family_data, s
...
@@ -1494,21 +1494,21 @@ static HRESULT fontfamily_add_font(struct dwrite_fontfamily_data *family_data, s
static
HRESULT
fontcollection_add_family
(
struct
dwrite_fontcollection
*
collection
,
struct
dwrite_fontfamily_data
*
family
)
static
HRESULT
fontcollection_add_family
(
struct
dwrite_fontcollection
*
collection
,
struct
dwrite_fontfamily_data
*
family
)
{
{
if
(
collection
->
data_alloc
<
collection
->
data
_count
+
1
)
{
if
(
collection
->
family_alloc
<
collection
->
family
_count
+
1
)
{
struct
dwrite_fontfamily_data
**
new_list
;
struct
dwrite_fontfamily_data
**
new_list
;
UINT32
new_alloc
;
UINT32
new_alloc
;
new_alloc
=
collection
->
data
_alloc
*
2
;
new_alloc
=
collection
->
family
_alloc
*
2
;
new_list
=
heap_realloc
(
collection
->
family_data
,
sizeof
(
*
new_list
)
*
new_alloc
);
new_list
=
heap_realloc
(
collection
->
family_data
,
sizeof
(
*
new_list
)
*
new_alloc
);
if
(
!
new_list
)
if
(
!
new_list
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
collection
->
data
_alloc
=
new_alloc
;
collection
->
family
_alloc
=
new_alloc
;
collection
->
family_data
=
new_list
;
collection
->
family_data
=
new_list
;
}
}
collection
->
family_data
[
collection
->
data
_count
]
=
family
;
collection
->
family_data
[
collection
->
family
_count
]
=
family
;
collection
->
data
_count
++
;
collection
->
family
_count
++
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1517,8 +1517,8 @@ static HRESULT init_font_collection(struct dwrite_fontcollection *collection)
...
@@ -1517,8 +1517,8 @@ static HRESULT init_font_collection(struct dwrite_fontcollection *collection)
{
{
collection
->
IDWriteFontCollection_iface
.
lpVtbl
=
&
fontcollectionvtbl
;
collection
->
IDWriteFontCollection_iface
.
lpVtbl
=
&
fontcollectionvtbl
;
collection
->
ref
=
1
;
collection
->
ref
=
1
;
collection
->
data
_count
=
0
;
collection
->
family
_count
=
0
;
collection
->
data
_alloc
=
2
;
collection
->
family
_alloc
=
2
;
collection
->
count
=
0
;
collection
->
count
=
0
;
collection
->
alloc
=
0
;
collection
->
alloc
=
0
;
collection
->
families
=
NULL
;
collection
->
families
=
NULL
;
...
@@ -1739,8 +1739,8 @@ HRESULT get_system_fontcollection(IDWriteFontCollection **collection)
...
@@ -1739,8 +1739,8 @@ HRESULT get_system_fontcollection(IDWriteFontCollection **collection)
heap_free
(
This
);
heap_free
(
This
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
This
->
data
_count
=
0
;
This
->
family
_count
=
0
;
This
->
data
_alloc
=
2
;
This
->
family
_alloc
=
2
;
This
->
family_data
=
heap_alloc
(
sizeof
(
*
This
->
family_data
)
*
2
);
This
->
family_data
=
heap_alloc
(
sizeof
(
*
This
->
family_data
)
*
2
);
if
(
!
This
->
family_data
)
if
(
!
This
->
family_data
)
{
{
...
...
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