[ros-diffs] [greatlrd] 27878: merge down 27768 : see bug 2055 (fixing restore / save right dc) See issue #2055 for more details.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Thu Jul 26 20:36:59 CEST 2007


Author: greatlrd
Date: Thu Jul 26 22:36:58 2007
New Revision: 27878

URL: http://svn.reactos.org/svn/reactos?rev=27878&view=rev
Log:
merge down 27768 : see bug 2055 (fixing restore / save right dc)
See issue #2055 for more details.

Modified:
    branches/ros-branch-0_3_3/reactos/subsystems/win32/win32k/objects/dc.c

Modified: branches/ros-branch-0_3_3/reactos/subsystems/win32/win32k/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_3/reactos/subsystems/win32/win32k/objects/dc.c?rev=27878&r1=27877&r2=27878&view=diff
==============================================================================
--- branches/ros-branch-0_3_3/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ branches/ros-branch-0_3_3/reactos/subsystems/win32/win32k/objects/dc.c Thu Jul 26 22:36:58 2007
@@ -1811,42 +1811,44 @@
     return FALSE;
   }
 
-  if(abs(SaveLevel) > dc->saveLevel || SaveLevel == 0)
+  if (SaveLevel < 0)
+      SaveLevel = dc->saveLevel + SaveLevel + 1;
+
+  if(SaveLevel < 0 || dc->saveLevel<SaveLevel)
   {
     DC_UnlockDc(dc);
     return FALSE;
   }
-
-  /* FIXME this calc are not 100% correct I think ??*/
-  if (SaveLevel < 0) SaveLevel = dc->saveLevel + SaveLevel + 1;
   
   success=TRUE;
   while (dc->saveLevel >= SaveLevel)
   {
      HDC hdcs = DC_GetNextDC (dc);
 
-	 dcs = DC_LockDc (hdcs);
+     dcs = DC_LockDc (hdcs);
      if (dcs == NULL)
      {
         DC_UnlockDc(dc);
         return FALSE;
      }
 
-	 DC_SetNextDC (dc, DC_GetNextDC (dcs));
-	 dcs->hNext = 0;
-		 
-	 if (--dc->saveLevel < SaveLevel)
-	 {
-		 DC_UnlockDc( dc );
+     DC_SetNextDC (dc, DC_GetNextDC (dcs));
+     dcs->hNext = 0;
+
+     if (--dc->saveLevel < SaveLevel)
+     {
+         DC_UnlockDc( dc );
          DC_UnlockDc( dcs );
 
-	     NtGdiSetDCState(hDC, hdcs);
-         //if (!PATH_AssignGdiPath( &dc->path, &dcs->path ))
-		 /* FIXME: This might not be quite right, since we're 
-		  * returning FALSE but still destroying the saved DC state 
-		  */
-	     success=FALSE;
-	     dc = DC_LockDc(hDC);
+         NtGdiSetDCState(hDC, hdcs);
+
+        if (!PATH_AssignGdiPath( &dc->w.path, &dcs->w.path ))
+        {
+          /* FIXME: This might not be quite right, since we're
+           * returning FALSE but still destroying the saved DC state */
+          success = FALSE;
+        }
+         dc = DC_LockDc(hDC);
          if(!dc)
          {
             return FALSE;




More information about the Ros-diffs mailing list