usp10: Handle the SSA_PASSWORD flag in ScriptStringAnalyse.

This commit is contained in:
Aric Stewart 2011-10-06 15:23:45 -05:00 committed by Alexandre Julliard
parent 905a819d7c
commit 95ca444692

View file

@ -914,6 +914,7 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString,
SCRIPT_STATE sState; SCRIPT_STATE sState;
int i, num_items = 255; int i, num_items = 255;
BYTE *BidiLevel; BYTE *BidiLevel;
WCHAR *iString = NULL;
TRACE("(%p,%p,%d,%d,%d,0x%x,%d,%p,%p,%p,%p,%p,%p)\n", TRACE("(%p,%p,%d,%d,%d,0x%x,%d,%p,%p,%p,%p,%p,%p)\n",
hdc, pString, cString, cGlyphs, iCharset, dwFlags, iReqWidth, hdc, pString, cString, cGlyphs, iCharset, dwFlags, iReqWidth,
@ -945,6 +946,14 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString,
else else
memset(&sControl, 0, sizeof(SCRIPT_CONTROL)); memset(&sControl, 0, sizeof(SCRIPT_CONTROL));
if (dwFlags & SSA_PASSWORD)
{
iString = heap_alloc(sizeof(WCHAR)*cString);
for (i = 0; i < cString; i++)
iString[i] = *((const WCHAR *)pString);
pString = iString;
}
hr = ScriptItemize(pString, cString, num_items, &sControl, &sState, analysis->pItem, hr = ScriptItemize(pString, cString, num_items, &sControl, &sState, analysis->pItem,
&analysis->numItems); &analysis->numItems);
@ -1026,9 +1035,11 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString,
heap_free(BidiLevel); heap_free(BidiLevel);
*pssa = analysis; *pssa = analysis;
heap_free(iString);
return S_OK; return S_OK;
error: error:
heap_free(iString);
heap_free(analysis->glyphs); heap_free(analysis->glyphs);
heap_free(analysis->logattrs); heap_free(analysis->logattrs);
heap_free(analysis->pItem); heap_free(analysis->pItem);