Spit out EMR_RESTOREDC metarecords with -1 as argument as long as we

don't get to the saved state we want.
This commit is contained in:
Dave Belanger 2003-10-07 03:32:28 +00:00 committed by Alexandre Julliard
parent ca2902f3d1
commit d1fa4b2d73
1 changed files with 15 additions and 2 deletions

View File

@ -33,11 +33,24 @@ INT EMFDRV_SaveDC( PHYSDEV dev )
BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level )
{ {
EMFDRV_PDEVICE* physDev = (EMFDRV_PDEVICE*)dev;
EMRRESTOREDC emr; EMRRESTOREDC emr;
emr.emr.iType = EMR_RESTOREDC; emr.emr.iType = EMR_RESTOREDC;
emr.emr.nSize = sizeof(emr); emr.emr.nSize = sizeof(emr);
emr.iRelative = level; emr.iRelative = -1;
return EMFDRV_WriteRecord( dev, &emr.emr ); if (level == -1)
return EMFDRV_WriteRecord( dev, &emr.emr );
else if (level > 0 && level <= physDev->dc->saveLevel)
{
while (level >= physDev->dc->saveLevel)
{
EMFDRV_WriteRecord( dev, &emr.emr );
level--;
}
return TRUE;
}
return FALSE;
} }
UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ) UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align )