From 9bee50f6d9c4d4055752239af432664a57923403 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 5 May 2010 14:59:07 +0100 Subject: [PATCH] gdi32: Fix ExtTextOutA -> W forwarding when ETO_PDY is set. --- dlls/gdi32/font.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index eea53fd2b2f..c21036d4f08 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1586,13 +1586,29 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags, if (lpDx) { unsigned int i = 0, j = 0; - lpDxW = HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(INT)); + /* allocate enough for a ETO_PDY */ + lpDxW = HeapAlloc( GetProcessHeap(), 0, 2*wlen*sizeof(INT)); while(i < count) { - if(IsDBCSLeadByteEx(codepage, str[i])) { - lpDxW[j++] = lpDx[i] + lpDx[i+1]; + if(IsDBCSLeadByteEx(codepage, str[i])) + { + if(flags & ETO_PDY) + { + lpDxW[j++] = lpDx[i * 2] + lpDx[(i + 1) * 2]; + lpDxW[j++] = lpDx[i * 2 + 1] + lpDx[(i + 1) * 2 + 1]; + } + else + lpDxW[j++] = lpDx[i] + lpDx[i + 1]; i = i + 2; - } else { - lpDxW[j++] = lpDx[i]; + } + else + { + if(flags & ETO_PDY) + { + lpDxW[j++] = lpDx[i * 2]; + lpDxW[j++] = lpDx[i * 2 + 1]; + } + else + lpDxW[j++] = lpDx[i]; i = i + 1; } } -- 2.11.4.GIT