Commit f629e979 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

gdi32: Don't write EMR_EXTSELECTCLIPRGN to emf file on SelectClipPath call.

parent a628412f
......@@ -479,13 +479,21 @@ BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSelectClipPath );
EMRSELECTCLIPPATH emr;
BOOL ret = FALSE;
HRGN hrgn;
emr.emr.iType = EMR_SELECTCLIPPATH;
emr.emr.nSize = sizeof(emr);
emr.iMode = iMode;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return FALSE;
return next->funcs->pSelectClipPath( next, iMode );
hrgn = PathToRegion( dev->hdc );
if (hrgn)
{
ret = next->funcs->pExtSelectClipRgn( next, hrgn, iMode );
DeleteObject( hrgn );
}
return ret;
}
BOOL EMFDRV_WidenPath( PHYSDEV dev )
......
......@@ -2432,16 +2432,16 @@ static const unsigned char EMF_CLIPPING[] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00,
0x1a, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
0xd0, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x7c, 0x01, 0x00, 0x00, 0x2c, 0x01, 0x00, 0x00,
0x80, 0x07, 0x00, 0x00, 0xb0, 0x04, 0x00, 0x00,
0xfc, 0x01, 0x00, 0x00, 0x3e, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x60, 0xcc, 0x05, 0x00,
0xe0, 0x93, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x60, 0xc0, 0x07, 0x00,
0x30, 0xda, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
......@@ -2451,9 +2451,16 @@ static const unsigned char EMF_CLIPPING[] =
0x64, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
0x64, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
0x00, 0x04, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00,
0x64, 0x00, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00,
0xff, 0x03, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00
};
static void translate( POINT *pt, UINT count, const XFORM *xform )
......@@ -2605,6 +2612,12 @@ static void test_emf_clipping(void)
ret = SelectClipRgn(hdc, hrgn);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
BeginPath(hdc);
Rectangle(hdc, rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom);
EndPath(hdc);
ret = SelectClipPath(hdc, RGN_AND);
ok(ret, "SelectClipPath error %d\n", GetLastError());
SetLastError(0xdeadbeef);
hemf = CloseEnhMetaFile(hdc);
ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError());
......
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