Fix for metafile ExtTextOut that only includes the rectangle if either

ETO_CLIPPED or ETO_OPAQUE is set.
Slightly less of a stub implementation for GetWinMetaFileBits.
This commit is contained in:
Huw D M Davies 2002-08-16 20:04:29 +00:00 committed by Alexandre Julliard
parent 0eec45a97b
commit b482e9ac0c
1 changed files with 13 additions and 3 deletions

View File

@ -1352,9 +1352,18 @@ UINT WINAPI GetWinMetaFileBits(HENHMETAFILE hemf,
UINT cbBuffer, LPBYTE lpbBuffer, UINT cbBuffer, LPBYTE lpbBuffer,
INT fnMapMode, HDC hdcRef) INT fnMapMode, HDC hdcRef)
{ {
HDC hdcmf;
HMETAFILE hmf;
UINT ret;
FIXME("(%d,%d,%p,%d,%d): stub\n", FIXME("(%d,%d,%p,%d,%d): stub\n",
hemf, cbBuffer, lpbBuffer, fnMapMode, hdcRef); hemf, cbBuffer, lpbBuffer, fnMapMode, hdcRef);
return 0; hdcmf = CreateMetaFileA(NULL);
/* PlayEnhMetaFile(hdcmf, hemf, lpRect); where does the bounding rect come from? */
hmf = CloseMetaFile(hdcmf);
ret = GetMetaFileBitsEx(hmf, cbBuffer, lpbBuffer);
DeleteMetaFile(hmf);
return ret;
} }
/****************************************************************** /******************************************************************
@ -1442,14 +1451,15 @@ static BOOL MF_Play_MetaExtTextOut(HDC16 hdc, METARECORD *mr)
LPSTR sot; LPSTR sot;
DWORD len; DWORD len;
WORD s1; WORD s1;
BOOL isrect = mr->rdParm[3] & (ETO_OPAQUE | ETO_CLIPPED);
s1 = mr->rdParm[2]; /* String length */ s1 = mr->rdParm[2]; /* String length */
len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short) len = sizeof(METARECORD) + (((s1 + 1) >> 1) * 2) + 2 * sizeof(short)
+ sizeof(UINT16) + (mr->rdParm[3] ? sizeof(RECT16) : 0); + sizeof(UINT16) + (isrect ? sizeof(RECT16) : 0);
/* rec len without dx array */ /* rec len without dx array */
sot = (LPSTR)&mr->rdParm[4]; /* start_of_text */ sot = (LPSTR)&mr->rdParm[4]; /* start_of_text */
if (mr->rdParm[3]) if (isrect)
sot += sizeof(RECT16); /* there is a rectangle, so add offset */ sot += sizeof(RECT16); /* there is a rectangle, so add offset */
if (mr->rdSize == len / 2) if (mr->rdSize == len / 2)