Huw Davies : gdi32: Fix ExtTextOutA -> W forwarding when ETO_PDY is set.
Alexandre Julliard
julliard at winehq.org
Wed May 5 11:08:37 CDT 2010
Module: wine
Branch: master
Commit: 9bee50f6d9c4d4055752239af432664a57923403
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9bee50f6d9c4d4055752239af432664a57923403
Author: Huw Davies <huw at codeweavers.com>
Date: Wed May 5 14:59:07 2010 +0100
gdi32: Fix ExtTextOutA -> W forwarding when ETO_PDY is set.
---
dlls/gdi32/font.c | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index eea53fd..c21036d 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;
}
}
More information about the wine-cvs
mailing list