usp10: Fix dead code in ScriptItemize.

This commit is contained in:
Jeff Latimer 2006-10-17 19:11:25 +10:00 committed by Alexandre Julliard
parent 35ee9b05d9
commit 292c99e329
2 changed files with 13 additions and 2 deletions

View File

@ -47,6 +47,7 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
WCHAR TestItem2[] = {'T', 'e', 's', 't', 'b', 0};
WCHAR TestItem3[] = {'T', 'e', 's', 't', 'c',' ','1','2','3',' ',' ','e','n','d',0};
WCHAR TestItem4[] = {'T', 'e', 's', 't', 'c',' ',0x0684,0x0694,0x06a4,' ',' ','e','n','d',0};
WCHAR TestItem5[] = {0x0684,'T','e','s','t','c',' ',0x0684,0x0694,0x06a4,' ',' ','e','n','d',0};
SCRIPT_CACHE psc;
int cChars;
@ -243,6 +244,16 @@ static void test_ScriptItemIzeShapePlace(HDC hdc, unsigned short pwOutGlyphs[256
hr = ScriptFreeCache( &psc);
ok (!psc, "psc is not null after ScriptFreeCache\n");
}
/*
* This test is for when the first unicode character requires bidi support
*/
cInChars = (sizeof(TestItem5)-1)/sizeof(WCHAR);
hr = ScriptItemize(TestItem5, cInChars, cMaxItems, NULL, NULL, pItem, &pcItems);
ok (hr == 0, "ScriptItemize should return 0, returned %08x\n", hr);
ok (pcItems == 4, "There should have been 4 items, found %d\n", pcItems);
ok (pItem[0].a.s.uBidiLevel == 1, "The first character should have been bidi=1 not %d\n",
pItem[0].a.s.uBidiLevel);
}
void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])

View File

@ -326,7 +326,7 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem
pItems[index].a.fLogicalOrder = 0;
pItems[index].a.fNoGlyphIndex = 0;
/* set the SCRIPT_STATE */
if (New_Script == Script_Arabic)
if (pItems[index].a.eScript == Script_Arabic)
pItems[index].a.s.uBidiLevel = 1;
else
pItems[index].a.s.uBidiLevel = 0;