Commit d9fcbf45 authored by Santino Mazza's avatar Santino Mazza Committed by Alexandre Julliard

mlang: Implement codepages priority.

parent 1ccd67cc
...@@ -3333,10 +3333,12 @@ static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages( IMLangFontLink2* iface, ...@@ -3333,10 +3333,12 @@ static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages( IMLangFontLink2* iface,
for (i = 0; i < src_len; i++) for (i = 0; i < src_len; i++)
{ {
DWORD cp; DWORD cp, next_cp = 0;
HRESULT ret; HRESULT ret;
ret = IMLangFontLink2_GetCharCodePages(iface, src[i], &cp); ret = IMLangFontLink2_GetCharCodePages(iface, src[i], &cp);
if (i + 1 < src_len)
ret = IMLangFontLink2_GetCharCodePages(iface, src[i + 1], &next_cp);
if (ret != S_OK) return E_FAIL; if (ret != S_OK) return E_FAIL;
if (!cps) cps = cp; if (!cps) cps = cp;
...@@ -3347,8 +3349,7 @@ static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages( IMLangFontLink2* iface, ...@@ -3347,8 +3349,7 @@ static HRESULT WINAPI fnIMLangFontLink2_GetStrCodePages( IMLangFontLink2* iface,
break; break;
} }
/* FIXME: not tested */ if ((priority_cp & cps) && !(priority_cp & next_cp)) break;
if (priority_cp & cps) break;
} }
if (codepages) *codepages = cps; if (codepages) *codepages = cps;
......
...@@ -1298,16 +1298,16 @@ static void IMLangFontLink_Test(IMLangFontLink* iMLFL) ...@@ -1298,16 +1298,16 @@ static void IMLangFontLink_Test(IMLangFontLink* iMLFL)
processed = 0; processed = 0;
ret = IMLangFontLink_GetStrCodePages(iMLFL, str, 4, FS_CYRILLIC, &dwCodePages, &processed); ret = IMLangFontLink_GetStrCodePages(iMLFL, str, 4, FS_CYRILLIC, &dwCodePages, &processed);
ok(ret == S_OK, "IMLangFontLink_GetStrCodePages error %lx\n", ret); ok(ret == S_OK, "IMLangFontLink_GetStrCodePages error %lx\n", ret);
todo_wine ok(dwCodePages == dwCmpCodePages, "expected %lx, got %lx\n", dwCmpCodePages, dwCodePages); ok(dwCodePages == dwCmpCodePages, "expected %lx, got %lx\n", dwCmpCodePages, dwCodePages);
todo_wine ok(processed == 2, "expected 2, got %ld\n", processed); ok(processed == 2, "expected 2, got %ld\n", processed);
dwCmpCodePages = FS_JISJAPAN; dwCmpCodePages = FS_JISJAPAN;
dwCodePages = 0; dwCodePages = 0;
processed = 0; processed = 0;
ret = IMLangFontLink_GetStrCodePages(iMLFL, str, 4, FS_JISJAPAN, &dwCodePages, &processed); ret = IMLangFontLink_GetStrCodePages(iMLFL, str, 4, FS_JISJAPAN, &dwCodePages, &processed);
ok(ret == S_OK, "IMLangFontLink_GetStrCodePages error %lx\n", ret); ok(ret == S_OK, "IMLangFontLink_GetStrCodePages error %lx\n", ret);
todo_wine ok(dwCodePages == dwCmpCodePages, "expected %lx, got %lx\n", dwCmpCodePages, dwCodePages); ok(dwCodePages == dwCmpCodePages, "expected %lx, got %lx\n", dwCmpCodePages, dwCodePages);
todo_wine ok(processed == 3, "expected 3, got %ld\n", processed); ok(processed == 3, "expected 3, got %ld\n", processed);
dwCmpCodePages = FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC | FS_GREEK | FS_TURKISH dwCmpCodePages = FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC | FS_GREEK | FS_TURKISH
| FS_HEBREW | FS_ARABIC | FS_BALTIC | FS_VIETNAMESE | FS_THAI | FS_HEBREW | FS_ARABIC | FS_BALTIC | FS_VIETNAMESE | FS_THAI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment