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
c435eb5c
Commit
c435eb5c
authored
Sep 19, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Sort localized strings by locale name.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ea07bc41
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
main.c
dlls/dwrite/main.c
+14
-0
opentype.c
dlls/dwrite/opentype.c
+3
-0
No files found.
dlls/dwrite/dwrite_private.h
View file @
c435eb5c
...
@@ -237,6 +237,7 @@ extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDE
...
@@ -237,6 +237,7 @@ extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDE
extern
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
add_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
clone_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
IDWriteLocalizedStrings
**
strings
)
DECLSPEC_HIDDEN
;
extern
HRESULT
clone_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
IDWriteLocalizedStrings
**
strings
)
DECLSPEC_HIDDEN
;
extern
void
set_en_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
void
set_en_localizedstring
(
IDWriteLocalizedStrings
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
extern
void
sort_localizedstrings
(
IDWriteLocalizedStrings
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_system_fontcollection
(
IDWriteFactory5
*
,
IDWriteFontCollection1
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_system_fontcollection
(
IDWriteFactory5
*
,
IDWriteFontCollection1
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_eudc_fontcollection
(
IDWriteFactory5
*
,
IDWriteFontCollection1
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
get_eudc_fontcollection
(
IDWriteFactory5
*
,
IDWriteFontCollection1
**
)
DECLSPEC_HIDDEN
;
extern
IDWriteTextAnalyzer
*
get_text_analyzer
(
void
)
DECLSPEC_HIDDEN
;
extern
IDWriteTextAnalyzer
*
get_text_analyzer
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/main.c
View file @
c435eb5c
...
@@ -520,6 +520,20 @@ void set_en_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *string)
...
@@ -520,6 +520,20 @@ void set_en_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *string)
}
}
}
}
static
int
localizedstrings_sorting_compare
(
const
void
*
left
,
const
void
*
right
)
{
const
struct
localizedpair
*
_l
=
left
,
*
_r
=
right
;
return
strcmpW
(
_l
->
locale
,
_r
->
locale
);
};
void
sort_localizedstrings
(
IDWriteLocalizedStrings
*
iface
)
{
struct
localizedstrings
*
strings
=
impl_from_IDWriteLocalizedStrings
(
iface
);
qsort
(
strings
->
data
,
strings
->
count
,
sizeof
(
*
strings
->
data
),
localizedstrings_sorting_compare
);
}
struct
collectionloader
struct
collectionloader
{
{
struct
list
entry
;
struct
list
entry
;
...
...
dlls/dwrite/opentype.c
View file @
c435eb5c
...
@@ -2010,6 +2010,9 @@ static HRESULT opentype_get_font_strings_from_id(const void *table_data, enum OP
...
@@ -2010,6 +2010,9 @@ static HRESULT opentype_get_font_strings_from_id(const void *table_data, enum OP
}
}
}
}
if
(
*
strings
)
sort_localizedstrings
(
*
strings
);
return
exists
?
S_OK
:
E_FAIL
;
return
exists
?
S_OK
:
E_FAIL
;
}
}
...
...
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