Use rect only if there are flags.

This commit is contained in:
Aric Stewart 2002-04-03 22:49:26 +00:00 committed by Alexandre Julliard
parent 160be64e9e
commit 1e6063d531
1 changed files with 7 additions and 7 deletions

View File

@ -38,11 +38,11 @@ static BOOL MFDRV_MetaExtTextOut( PHYSDEV dev, short x, short y, UINT16 flags,
DWORD len; DWORD len;
METARECORD *mr; METARECORD *mr;
if((!flags && rect) || (flags && !rect)) if (flags && !rect)
WARN("Inconsistent flags and rect\n"); WARN("Inconsistent flags and rect\n");
len = sizeof(METARECORD) + (((count + 1) >> 1) * 2) + 2 * sizeof(short) len = sizeof(METARECORD) + (((count + 1) >> 1) * 2) + 2 * sizeof(short)
+ sizeof(UINT16); + sizeof(UINT16);
if(rect) if (rect&&flags)
len += sizeof(RECT16); len += sizeof(RECT16);
if (lpDx) if (lpDx)
len+=count*sizeof(INT16); len+=count*sizeof(INT16);
@ -55,10 +55,10 @@ static BOOL MFDRV_MetaExtTextOut( PHYSDEV dev, short x, short y, UINT16 flags,
*(mr->rdParm + 1) = x; *(mr->rdParm + 1) = x;
*(mr->rdParm + 2) = count; *(mr->rdParm + 2) = count;
*(mr->rdParm + 3) = flags; *(mr->rdParm + 3) = flags;
if (rect) memcpy(mr->rdParm + 4, rect, sizeof(RECT16)); if (rect&&flags) memcpy(mr->rdParm + 4, rect, sizeof(RECT16));
memcpy(mr->rdParm + (rect ? 8 : 4), str, count); memcpy(mr->rdParm + ((rect&&flags) ? 8 : 4), str, count);
if (lpDx) if (lpDx)
memcpy(mr->rdParm + (rect ? 8 : 4) + ((count + 1) >> 1),lpDx, memcpy(mr->rdParm + ((rect&&flags) ? 8 : 4) + ((count + 1) >> 1),lpDx,
count*sizeof(INT16)); count*sizeof(INT16));
ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2); ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2);
HeapFree( GetProcessHeap(), 0, mr); HeapFree( GetProcessHeap(), 0, mr);