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
b86552f5
Commit
b86552f5
authored
Feb 25, 2009
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang: Implement IMLangFontLink_GetStrCodePages.
parent
6aa216fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
20 deletions
+113
-20
mlang.c
dlls/mlang/mlang.c
+30
-7
mlang.c
dlls/mlang/tests/mlang.c
+83
-13
No files found.
dlls/mlang/mlang.c
View file @
b86552f5
...
...
@@ -1912,9 +1912,34 @@ static HRESULT WINAPI fnIMLangFontLink_GetStrCodePages(
DWORD
*
pdwCodePages
,
long
*
pcchCodePages
)
{
FIXME
(
"(pszSrc=%s, cchSrc=%ld, dwPriorityCodePages=%d) stub
\n
"
,
debugstr_w
(
pszSrc
),
cchSrc
,
dwPriorityCodePages
);
*
pdwCodePages
=
0
;
*
pcchCodePages
=
1
;
long
i
;
DWORD
cps
=
0
;
TRACE
(
"(%p)->%s %ld %x %p %p
\n
"
,
iface
,
debugstr_wn
(
pszSrc
,
cchSrc
),
cchSrc
,
dwPriorityCodePages
,
pdwCodePages
,
pcchCodePages
);
if
(
pdwCodePages
)
*
pdwCodePages
=
0
;
if
(
pcchCodePages
)
*
pcchCodePages
=
0
;
if
(
!
pszSrc
||
!
cchSrc
||
cchSrc
<
0
)
return
E_INVALIDARG
;
for
(
i
=
0
;
i
<
cchSrc
;
i
++
)
{
DWORD
cp
;
HRESULT
ret
;
ret
=
fnIMLangFontLink_GetCharCodePages
(
iface
,
pszSrc
[
i
],
&
cp
);
if
(
ret
!=
S_OK
)
return
E_FAIL
;
if
(
!
cps
)
cps
=
cp
;
else
cps
&=
cp
;
/* FIXME: not tested */
if
(
dwPriorityCodePages
&
cps
)
break
;
}
if
(
pdwCodePages
)
*
pdwCodePages
=
cps
;
if
(
pcchCodePages
)
*
pcchCodePages
=
i
;
return
S_OK
;
}
...
...
@@ -3179,10 +3204,8 @@ static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages( IMLangFontLink2* This,
const
WCHAR
*
pszSrc
,
long
cchSrc
,
DWORD
dwPriorityCodePages
,
DWORD
*
pdwCodePages
,
long
*
pcchCodePages
)
{
FIXME
(
"(%p)->%s %li %x %p %p
\n
"
,
This
,
debugstr_wn
(
pszSrc
,
cchSrc
),
cchSrc
,
dwPriorityCodePages
,
pdwCodePages
,
pcchCodePages
);
*
pdwCodePages
=
0
;
*
pcchCodePages
=
1
;
return
S_OK
;
return
fnIMLangFontLink_GetStrCodePages
((
IMLangFontLink
*
)
This
,
pszSrc
,
cchSrc
,
dwPriorityCodePages
,
pdwCodePages
,
pcchCodePages
);
}
static
HRESULT
WINAPI
fnIMLangFontLink2_CodePageToCodePages
(
IMLangFontLink2
*
This
,
...
...
dlls/mlang/tests/mlang.c
View file @
b86552f5
...
...
@@ -211,7 +211,7 @@ static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2)
ok
(
lenA
==
expected_len
,
"expected lenA %u, got %u
\n
"
,
expected_len
,
lenA
);
}
static
inline
void
cpinfo_cmp
(
MIMECPINFO
*
cpinfo1
,
MIMECPINFO
*
cpinfo2
)
static
void
cpinfo_cmp
(
MIMECPINFO
*
cpinfo1
,
MIMECPINFO
*
cpinfo2
)
{
ok
(
cpinfo1
->
dwFlags
==
cpinfo2
->
dwFlags
,
"dwFlags mismatch: %08x != %08x
\n
"
,
cpinfo1
->
dwFlags
,
cpinfo2
->
dwFlags
);
ok
(
cpinfo1
->
uiCodePage
==
cpinfo2
->
uiCodePage
,
"uiCodePage mismatch: %u != %u
\n
"
,
cpinfo1
->
uiCodePage
,
cpinfo2
->
uiCodePage
);
...
...
@@ -538,7 +538,7 @@ static void test_EnumCodePages(IMultiLanguage2 *iML2, DWORD flags)
IEnumCodePage_Release
(
iEnumCP
);
}
static
inline
void
scriptinfo_cmp
(
SCRIPTINFO
*
sinfo1
,
SCRIPTINFO
*
sinfo2
)
static
void
scriptinfo_cmp
(
SCRIPTINFO
*
sinfo1
,
SCRIPTINFO
*
sinfo2
)
{
ok
(
sinfo1
->
ScriptId
==
sinfo2
->
ScriptId
,
"ScriptId mismatch: %d != %d
\n
"
,
sinfo1
->
ScriptId
,
sinfo2
->
ScriptId
);
ok
(
sinfo1
->
uiCodePage
==
sinfo2
->
uiCodePage
,
"uiCodePage mismatch: %u != %u
\n
"
,
sinfo1
->
uiCodePage
,
sinfo2
->
uiCodePage
);
...
...
@@ -649,6 +649,8 @@ static void IMLangFontLink_Test(IMLangFontLink* iMLFL)
DWORD
dwCodePages
,
dwManyCodePages
;
DWORD
dwCmpCodePages
;
UINT
CodePage
;
static
const
WCHAR
str
[
3
]
=
{
'd'
,
0x0436
,
0xff90
};
long
processed
;
HRESULT
ret
;
dwCodePages
=
~
0u
;
...
...
@@ -693,21 +695,89 @@ static void IMLangFontLink_Test(IMLangFontLink* iMLFL)
dwCmpCodePages
=
FS_LATIN1
|
FS_LATIN2
|
FS_CYRILLIC
|
FS_GREEK
|
FS_TURKISH
|
FS_HEBREW
|
FS_ARABIC
|
FS_BALTIC
|
FS_VIETNAMESE
|
FS_THAI
|
FS_JISJAPAN
|
FS_CHINESESIMP
|
FS_WANSUNG
|
FS_CHINESETRAD
;
ok
(
IMLangFontLink_GetCharCodePages
(
iMLFL
,
'd'
,
&
dwCodePages
)
==
S_OK
,
"IMLangFontLink_GetCharCodePages failed
\n
"
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"Incorrect CodePages returned (%i)
\n
"
,
dwCodePages
);
ret
=
IMLangFontLink_GetCharCodePages
(
iMLFL
,
'd'
,
&
dwCodePages
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetCharCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
dwCodePages
=
0
;
processed
=
0
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
&
str
[
0
],
1
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetStrCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
1
,
"expected 1, got %ld
\n
"
,
processed
);
/* Cyrillic */
dwCmpCodePages
=
FS_CYRILLIC
|
FS_JISJAPAN
|
FS_CHINESESIMP
|
FS_WANSUNG
;
ok
(
IMLangFontLink_GetCharCodePages
(
iMLFL
,
0x0436
,
&
dwCodePages
)
==
S_OK
,
"IMLangFontLink_GetCharCodePages failed
\n
"
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"Incorrect CodePages returned (%i)
\n
"
,
dwCodePages
);
ret
=
IMLangFontLink_GetCharCodePages
(
iMLFL
,
0x0436
,
&
dwCodePages
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetCharCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
dwCodePages
=
0
;
processed
=
0
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
&
str
[
1
],
1
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetStrCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
1
,
"expected 1, got %ld
\n
"
,
processed
);
/* Japanese */
dwCmpCodePages
=
FS_JISJAPAN
;
ok
(
IMLangFontLink_GetCharCodePages
(
iMLFL
,
0xff90
,
&
dwCodePages
)
==
S_OK
,
"IMLangFontLink_GetCharCodePages failed
\n
"
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"Incorrect CodePages returned (%i)
\n
"
,
dwCodePages
);
ret
=
IMLangFontLink_GetCharCodePages
(
iMLFL
,
0xff90
,
&
dwCodePages
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetCharCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
dwCodePages
=
0
;
processed
=
0
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
&
str
[
2
],
1
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetStrCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
1
,
"expected 1, got %ld
\n
"
,
processed
);
dwCmpCodePages
=
FS_CYRILLIC
|
FS_JISJAPAN
|
FS_CHINESESIMP
|
FS_WANSUNG
;
dwCodePages
=
0
;
processed
=
0
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
str
,
2
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetStrCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
2
,
"expected 2, got %ld
\n
"
,
processed
);
dwCmpCodePages
=
FS_JISJAPAN
;
dwCodePages
=
0
;
processed
=
0
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
str
,
3
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetStrCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
3
,
"expected 3, got %ld
\n
"
,
processed
);
dwCodePages
=
0xffff
;
processed
=
-
1
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
&
str
[
2
],
1
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetStrCodePages error %x
\n
"
,
ret
);
ok
(
dwCodePages
==
dwCmpCodePages
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
1
,
"expected 0, got %ld
\n
"
,
processed
);
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
&
str
[
2
],
1
,
0
,
NULL
,
NULL
);
ok
(
ret
==
S_OK
,
"IMLangFontLink_GetStrCodePages error %x
\n
"
,
ret
);
dwCodePages
=
0xffff
;
processed
=
-
1
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
str
,
-
1
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
E_INVALIDARG
,
"IMLangFontLink_GetStrCodePages should fail: %x
\n
"
,
ret
);
ok
(
dwCodePages
==
0
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
0
,
"expected 0, got %ld
\n
"
,
processed
);
dwCodePages
=
0xffff
;
processed
=
-
1
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
NULL
,
1
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
E_INVALIDARG
,
"IMLangFontLink_GetStrCodePages should fail: %x
\n
"
,
ret
);
ok
(
dwCodePages
==
0
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
0
,
"expected 0, got %ld
\n
"
,
processed
);
dwCodePages
=
0xffff
;
processed
=
-
1
;
ret
=
IMLangFontLink_GetStrCodePages
(
iMLFL
,
str
,
0
,
0
,
&
dwCodePages
,
&
processed
);
ok
(
ret
==
E_INVALIDARG
,
"IMLangFontLink_GetStrCodePages should fail: %x
\n
"
,
ret
);
ok
(
dwCodePages
==
0
,
"expected %x, got %x
\n
"
,
dwCmpCodePages
,
dwCodePages
);
ok
(
processed
==
0
,
"expected 0, got %ld
\n
"
,
processed
);
}
/* copied from libs/wine/string.c */
...
...
@@ -1395,7 +1465,7 @@ static void test_GetScriptFontInfo(IMLangFontLink2 *font_link)
hr
=
IMLangFontLink2_GetScriptFontInfo
(
font_link
,
sidLatin
,
SCRIPTCONTF_FIXED_FONT
,
&
nfonts
,
sfi
);
ok
(
hr
==
S_OK
,
"GetScriptFontInfo failed %u
\n
"
,
GetLastError
());
ok
(
nfonts
==
1
,
"got %u, expected 1
\n
"
,
nfonts
);
ok
(
sfi
[
0
].
scripts
,
"unexpected result
\n
"
);
ok
(
sfi
[
0
].
scripts
!=
0
,
"unexpected result
\n
"
);
ok
(
sfi
[
0
].
wszFont
[
0
],
"unexpected result
\n
"
);
nfonts
=
1
;
...
...
@@ -1403,7 +1473,7 @@ static void test_GetScriptFontInfo(IMLangFontLink2 *font_link)
hr
=
IMLangFontLink2_GetScriptFontInfo
(
font_link
,
sidLatin
,
SCRIPTCONTF_PROPORTIONAL_FONT
,
&
nfonts
,
sfi
);
ok
(
hr
==
S_OK
,
"GetScriptFontInfo failed %u
\n
"
,
GetLastError
());
ok
(
nfonts
==
1
,
"got %u, expected 1
\n
"
,
nfonts
);
ok
(
sfi
[
0
].
scripts
,
"unexpected result
\n
"
);
ok
(
sfi
[
0
].
scripts
!=
0
,
"unexpected result
\n
"
);
ok
(
sfi
[
0
].
wszFont
[
0
],
"unexpected result
\n
"
);
}
...
...
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