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
31121442
Commit
31121442
authored
Dec 02, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use consistent trace format for strings object.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
87260918
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
24 deletions
+30
-24
main.c
dlls/dwrite/main.c
+30
-24
No files found.
dlls/dwrite/main.c
View file @
31121442
...
...
@@ -258,9 +258,7 @@ static inline struct localizedstrings *impl_from_IDWriteLocalizedStrings(IDWrite
static
HRESULT
WINAPI
localizedstrings_QueryInterface
(
IDWriteLocalizedStrings
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
localizedstrings
*
This
=
impl_from_IDWriteLocalizedStrings
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteLocalizedStrings
))
{
...
...
@@ -358,60 +356,66 @@ static HRESULT WINAPI localizedstrings_GetLocaleNameLength(IDWriteLocalizedStrin
static
HRESULT
WINAPI
localizedstrings_GetLocaleName
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
WCHAR
*
buffer
,
UINT32
size
)
{
struct
localizedstrings
*
Thi
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
struct
localizedstrings
*
string
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
TRACE
(
"
(%p)->(%u %p %u)
\n
"
,
This
,
index
,
buffer
,
size
);
TRACE
(
"
%p, %u, %p, %u.
\n
"
,
iface
,
index
,
buffer
,
size
);
if
(
index
>=
This
->
count
)
{
if
(
index
>=
strings
->
count
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_FAIL
;
}
if
(
size
<
strlenW
(
This
->
data
[
index
].
locale
)
+
1
)
{
if
(
size
<
strlenW
(
strings
->
data
[
index
].
locale
)
+
1
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_NOT_SUFFICIENT_BUFFER
;
}
strcpyW
(
buffer
,
Thi
s
->
data
[
index
].
locale
);
strcpyW
(
buffer
,
string
s
->
data
[
index
].
locale
);
return
S_OK
;
}
static
HRESULT
WINAPI
localizedstrings_GetStringLength
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
UINT32
*
length
)
{
struct
localizedstrings
*
Thi
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
struct
localizedstrings
*
string
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
TRACE
(
"
(%p)->(%u %p)
\n
"
,
This
,
index
,
length
);
TRACE
(
"
%p, %u, %p.
\n
"
,
iface
,
index
,
length
);
if
(
index
>=
This
->
count
)
{
*
length
=
(
UINT32
)
-
1
;
if
(
index
>=
strings
->
count
)
{
*
length
=
~
0u
;
return
E_FAIL
;
}
*
length
=
strlenW
(
Thi
s
->
data
[
index
].
string
);
*
length
=
strlenW
(
string
s
->
data
[
index
].
string
);
return
S_OK
;
}
static
HRESULT
WINAPI
localizedstrings_GetString
(
IDWriteLocalizedStrings
*
iface
,
UINT32
index
,
WCHAR
*
buffer
,
UINT32
size
)
{
struct
localizedstrings
*
Thi
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
struct
localizedstrings
*
string
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
TRACE
(
"
(%p)->(%u %p %u)
\n
"
,
This
,
index
,
buffer
,
size
);
TRACE
(
"
%p, %u, %p, %u.
\n
"
,
iface
,
index
,
buffer
,
size
);
if
(
index
>=
This
->
count
)
{
if
(
index
>=
strings
->
count
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_FAIL
;
}
if
(
size
<
strlenW
(
This
->
data
[
index
].
string
)
+
1
)
{
if
(
size
<
strlenW
(
strings
->
data
[
index
].
string
)
+
1
)
{
if
(
buffer
)
*
buffer
=
0
;
return
E_NOT_SUFFICIENT_BUFFER
;
}
strcpyW
(
buffer
,
Thi
s
->
data
[
index
].
string
);
strcpyW
(
buffer
,
string
s
->
data
[
index
].
string
);
return
S_OK
;
}
static
const
IDWriteLocalizedStringsVtbl
localizedstringsvtbl
=
{
static
const
IDWriteLocalizedStringsVtbl
localizedstringsvtbl
=
{
localizedstrings_QueryInterface
,
localizedstrings_AddRef
,
localizedstrings_Release
,
...
...
@@ -511,13 +515,15 @@ HRESULT clone_localizedstrings(IDWriteLocalizedStrings *iface, IDWriteLocalizedS
void
set_en_localizedstring
(
IDWriteLocalizedStrings
*
iface
,
const
WCHAR
*
string
)
{
static
const
WCHAR
enusW
[]
=
{
'e'
,
'n'
,
'-'
,
'U'
,
'S'
,
0
};
struct
localizedstrings
*
Thi
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
struct
localizedstrings
*
string
s
=
impl_from_IDWriteLocalizedStrings
(
iface
);
UINT32
i
;
for
(
i
=
0
;
i
<
This
->
count
;
i
++
)
{
if
(
!
strcmpiW
(
This
->
data
[
i
].
locale
,
enusW
))
{
heap_free
(
This
->
data
[
i
].
string
);
This
->
data
[
i
].
string
=
heap_strdupW
(
string
);
for
(
i
=
0
;
i
<
strings
->
count
;
i
++
)
{
if
(
!
strcmpiW
(
strings
->
data
[
i
].
locale
,
enusW
))
{
heap_free
(
strings
->
data
[
i
].
string
);
strings
->
data
[
i
].
string
=
heap_strdupW
(
string
);
break
;
}
}
...
...
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