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
23006025
Commit
23006025
authored
Oct 24, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use helpers to search through loaders lists.
parent
42882f7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
main.c
dlls/dwrite/main.c
+20
-16
No files found.
dlls/dwrite/main.c
View file @
23006025
...
...
@@ -495,6 +495,20 @@ static struct fileloader *factory_get_file_loader(struct dwritefactory *factory,
return
found
;
}
static
struct
collectionloader
*
factory_get_collection_loader
(
struct
dwritefactory
*
factory
,
IDWriteFontCollectionLoader
*
loader
)
{
struct
collectionloader
*
entry
,
*
found
=
NULL
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
factory
->
collection_loaders
,
struct
collectionloader
,
entry
)
{
if
(
entry
->
loader
==
loader
)
{
found
=
entry
;
break
;
}
}
return
found
;
}
static
HRESULT
WINAPI
dwritefactory_QueryInterface
(
IDWriteFactory
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
(
iface
);
...
...
@@ -575,10 +589,8 @@ static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory
if
(
!
loader
)
return
E_INVALIDARG
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
collection_loaders
,
struct
collectionloader
,
entry
)
{
if
(
entry
->
loader
==
loader
)
return
DWRITE_E_ALREADYREGISTERED
;
}
if
(
factory_get_collection_loader
(
This
,
loader
))
return
DWRITE_E_ALREADYREGISTERED
;
entry
=
heap_alloc
(
sizeof
(
*
entry
));
if
(
!
entry
)
...
...
@@ -595,20 +607,14 @@ static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactor
IDWriteFontCollectionLoader
*
loader
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory
(
iface
);
struct
collectionloader
*
entry
,
*
found
=
NULL
;
struct
collectionloader
*
found
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
loader
);
if
(
!
loader
)
return
E_INVALIDARG
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
collection_loaders
,
struct
collectionloader
,
entry
)
{
if
(
entry
->
loader
==
loader
)
{
found
=
entry
;
break
;
}
}
found
=
factory_get_collection_loader
(
This
,
loader
);
if
(
!
found
)
return
E_INVALIDARG
;
...
...
@@ -784,10 +790,8 @@ static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory *iface
if
(
!
loader
)
return
E_INVALIDARG
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
This
->
file_loaders
,
struct
fileloader
,
entry
)
{
if
(
entry
->
loader
==
loader
)
return
DWRITE_E_ALREADYREGISTERED
;
}
if
(
factory_get_file_loader
(
This
,
loader
))
return
DWRITE_E_ALREADYREGISTERED
;
entry
=
heap_alloc
(
sizeof
(
*
entry
));
if
(
!
entry
)
...
...
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