Dmitry Timoshkov : gdi32: Make EnumEnhMetaFile update the DC state before calling the callback.

Alexandre Julliard julliard at winehq.org
Wed Oct 22 08:00:20 CDT 2008


Module: wine
Branch: master
Commit: d1fe894a7d55524af4184e99f4c38ecf51b5c5b0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d1fe894a7d55524af4184e99f4c38ecf51b5c5b0

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Wed Oct 22 13:43:19 2008 +0900

gdi32: Make EnumEnhMetaFile update the DC state before calling the callback.

This makes applications with custom callbacks work properly, and fixes
'make test' in a win9x mode.

---

 dlls/gdi32/enhmetafile.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/dlls/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c
index ef53910..e998c60 100644
--- a/dlls/gdi32/enhmetafile.c
+++ b/dlls/gdi32/enhmetafile.c
@@ -756,10 +756,6 @@ BOOL WINAPI PlayEnhMetaFileRecord(
 
   type = mr->iType;
 
-  /* In Win9x mode we update the xform if the record will produce output */
-  if ( IS_WIN9X() && emr_produces_output(type) )
-     EMF_Update_MF_Xform(hdc, info);
-
   TRACE("record %s\n", get_emr_name(type));
   switch(type)
     {
@@ -2193,13 +2189,6 @@ BOOL WINAPI PlayEnhMetaFileRecord(
   TRACE("L:0,0 - 1000,1000 -> D:%d,%d - %d,%d\n", tmprc.left,
 	tmprc.top, tmprc.right, tmprc.bottom);
 
-  if ( !IS_WIN9X() )
-  {
-    /* WinNT - update the transform (win9x updates when the next graphics output
-       record is played). */
-    EMF_Update_MF_Xform(hdc, info);
-  }
-
   return TRUE;
 }
 
@@ -2405,9 +2394,19 @@ BOOL WINAPI EnumEnhMetaFile(
     while(ret && offset < emh->nBytes)
     {
 	emr = (ENHMETARECORD *)((char *)emh + offset);
+
+        /* In Win9x mode we update the xform if the record will produce output */
+        if (hdc && IS_WIN9X() && emr_produces_output(emr->iType))
+            EMF_Update_MF_Xform(hdc, info);
+
 	TRACE("Calling EnumFunc with record %s, size %d\n", get_emr_name(emr->iType), emr->nSize);
 	ret = (*callback)(hdc, ht, emr, emh->nHandles, (LPARAM)data);
 	offset += emr->nSize;
+
+        /* WinNT - update the transform (win9x updates when the next graphics
+           output record is played). */
+        if (hdc && !IS_WIN9X())
+            EMF_Update_MF_Xform(hdc, info);
     }
 
     if (hdc)




More information about the wine-cvs mailing list