Commit 1543be81 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

gdi32: Move common SetLayout() code to nulldrv_SetLayout().

parent aadf11fb
......@@ -1922,17 +1922,7 @@ DWORD WINAPI SetLayout(HDC hdc, DWORD layout)
if (dc)
{
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSetLayout );
layout = physdev->funcs->pSetLayout( physdev, layout );
if (layout != GDI_ERROR)
{
oldlayout = dc->layout;
dc->layout = layout;
if (layout != oldlayout)
{
if (layout & LAYOUT_RTL) dc->MapMode = MM_ANISOTROPIC;
DC_UpdateXforms( dc );
}
}
oldlayout = physdev->funcs->pSetLayout( physdev, layout );
release_dc_ptr( dc );
}
......
......@@ -795,7 +795,18 @@ static void CDECL nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
static DWORD CDECL nulldrv_SetLayout( PHYSDEV dev, DWORD layout )
{
return layout;
DC *dc = get_nulldrv_dc( dev );
DWORD old_layout;
old_layout = dc->layout;
dc->layout = layout;
if (layout != old_layout)
{
if (layout & LAYOUT_RTL) dc->MapMode = MM_ANISOTROPIC;
DC_UpdateXforms( dc );
}
return old_layout;
}
static BOOL CDECL nulldrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
......
......@@ -334,12 +334,14 @@ BOOL CDECL EMFDRV_ScaleWindowExtEx( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
DWORD CDECL EMFDRV_SetLayout( PHYSDEV dev, DWORD layout )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetMapMode );
EMRSETLAYOUT emr;
emr.emr.iType = EMR_SETLAYOUT;
emr.emr.nSize = sizeof(emr);
emr.iMode = layout;
return EMFDRV_WriteRecord( dev, &emr.emr ) ? layout : GDI_ERROR;
if (!EMFDRV_WriteRecord( dev, &emr.emr )) return GDI_ERROR;
return next->funcs->pSetLayout( next, layout );
}
BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform)
......
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