mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
usp10: Add tests and fix for ScriptXtoCP .
This commit is contained in:
parent
aa8392c9e7
commit
39a5b0760c
@ -574,6 +574,25 @@ static void test_ScriptXtoX(void)
|
||||
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
|
||||
ok(piCP == 4, "iX=%d should return piCP=4 not %d\n", iX, piCP);
|
||||
|
||||
iX = 0;
|
||||
cChars = 10;
|
||||
cGlyphs = 10;
|
||||
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
|
||||
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
|
||||
ok(piCP == 0, "iX=%d should return piCP=0 not %d\n", iX, piCP);
|
||||
iX = 195;
|
||||
cChars = 10;
|
||||
cGlyphs = 10;
|
||||
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
|
||||
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
|
||||
ok(piCP == 0, "iX=%d should return piCP=0 not %d\n", iX, piCP);
|
||||
iX = 196;
|
||||
cChars = 10;
|
||||
cGlyphs = 10;
|
||||
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
|
||||
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
|
||||
ok(piCP == 1, "iX=%d should return piCP=1 not %d\n", iX, piCP);
|
||||
|
||||
iCP=5;
|
||||
fTrailing = FALSE;
|
||||
cChars = 10;
|
||||
|
@ -561,7 +561,7 @@ HRESULT WINAPI ScriptXtoCP(int iX,
|
||||
int *piTrailing)
|
||||
{
|
||||
int item;
|
||||
int iPosX = 1;
|
||||
int iPosX;
|
||||
float fMaxPosX = 1;
|
||||
float fAvePosX;
|
||||
TRACE("(%d,%d,%d,%p,%p,%p,%p,%p,%p)\n",
|
||||
@ -585,8 +585,9 @@ HRESULT WINAPI ScriptXtoCP(int iX,
|
||||
}
|
||||
|
||||
fAvePosX = fMaxPosX / cGlyphs;
|
||||
for (item = 0; item < cGlyphs && iPosX < iX; item++)
|
||||
iPosX = fAvePosX * (item +1);
|
||||
iPosX = fAvePosX;
|
||||
for (item = 1; item < cGlyphs && iPosX < iX; item++)
|
||||
iPosX += fAvePosX;
|
||||
if (iPosX - iX > fAvePosX/2)
|
||||
*piTrailing = 0;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user