Commit 7faae4c5 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Fixed some issues in EMFDRV_ExtTextOut.

parent 6ac67518
...@@ -643,8 +643,7 @@ BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, ...@@ -643,8 +643,7 @@ BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
BOOL ret; BOOL ret;
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev; EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev;
nSize = sizeof(*pemr) + (count+1)/2 * 2 * sizeof(WCHAR) + nSize = sizeof(*pemr) + ((count+1) & ~1) * sizeof(WCHAR) + count * sizeof(INT);
(lpDx ? count * sizeof(INT) : 0);
TRACE("%s count %d nSize = %ld\n", debugstr_wn(str, count), count, nSize); TRACE("%s count %d nSize = %ld\n", debugstr_wn(str, count), count, nSize);
pemr = HeapAlloc(GetProcessHeap(), 0, nSize); pemr = HeapAlloc(GetProcessHeap(), 0, nSize);
...@@ -675,13 +674,18 @@ BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, ...@@ -675,13 +674,18 @@ BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
pemr->emrtext.rcl.bottom = lprect->bottom; pemr->emrtext.rcl.bottom = lprect->bottom;
} }
if(lpDx) { pemr->emrtext.offDx = pemr->emrtext.offString + count * sizeof(WCHAR);
pemr->emrtext.offDx = sizeof(*pemr) + (count+1)/2 * 2 * sizeof(WCHAR); if(lpDx)
memcpy((char*)pemr + pemr->emrtext.offDx, lpDx, count * sizeof(INT)); memcpy((char*)pemr + pemr->emrtext.offDx, lpDx, count * sizeof(INT));
} else else
pemr->emrtext.offDx = 0; /* FIXME: actually Windows fills out the array {
using GetCharWidth in this case */ UINT i;
INT *dx = (INT *)((char*)pemr + pemr->emrtext.offDx);
for (i = 0; i < count; i++)
{
GetCharWidth32W(physDev->hdc, str[i], str[i], &dx[i]);
}
}
ret = EMFDRV_WriteRecord( dev, &pemr->emr ); ret = EMFDRV_WriteRecord( dev, &pemr->emr );
if(ret) if(ret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment