fix catalan trade miniwindow by making buffer large enough to convert

text without errors.
This commit is contained in:
ehouse 2009-10-23 07:53:31 +00:00
parent b126b8b6bf
commit 8ec7b01595

View file

@ -753,7 +753,7 @@ ceMeasureText( CEDrawCtx* dctx, HDC hdc, const FontCacheEntry* fce,
XP_U16 maxWidth = 0; XP_U16 maxWidth = 0;
for ( ; ; ) { for ( ; ; ) {
wchar_t widebuf[32]; wchar_t widebuf[64];
XP_UCHAR* nextStr = strstr( str, XP_CR ); XP_UCHAR* nextStr = strstr( str, XP_CR );
XP_U16 len = nextStr==NULL? strlen(str): nextStr - str; XP_U16 len = nextStr==NULL? strlen(str): nextStr - str;
XP_U16 wlen; XP_U16 wlen;
@ -761,9 +761,9 @@ ceMeasureText( CEDrawCtx* dctx, HDC hdc, const FontCacheEntry* fce,
XP_ASSERT( nextStr != str ); XP_ASSERT( nextStr != str );
wlen = MultiByteToWideChar( dctx->codePage, 0, str, len, wlen = MultiByteToWideChar( CP_UTF8, 0, str, len,
widebuf, VSIZE(widebuf) ); widebuf, VSIZE(widebuf) );
GetTextExtentPoint32( hdc, widebuf, wlen, &size ); (void)GetTextExtentPoint32( hdc, widebuf, wlen, &size );
maxWidth = (XP_U16)XP_MAX( maxWidth, size.cx ); maxWidth = (XP_U16)XP_MAX( maxWidth, size.cx );
if ( !!fce ) { if ( !!fce ) {
@ -1108,6 +1108,7 @@ drawDrawTileGuts( DrawCtx* p_dctx, const XP_Rect* xprect,
const XP_UCHAR* letters, const XP_Bitmaps* bitmaps, const XP_UCHAR* letters, const XP_Bitmaps* bitmaps,
XP_U16 val, CellFlags flags ) XP_U16 val, CellFlags flags )
{ {
#ifndef NO_DRAW
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx; CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
CEAppGlobals* globals = dctx->globals; CEAppGlobals* globals = dctx->globals;
HDC hdc = globals->hdc; HDC hdc = globals->hdc;
@ -1214,6 +1215,7 @@ drawDrawTileGuts( DrawCtx* p_dctx, const XP_Rect* xprect,
} }
} }
} }
#endif
} /* drawDrawTileGuts */ } /* drawDrawTileGuts */
DLSTATIC void DLSTATIC void