[ros-diffs] [gedmurphy] 30043: - don't pass minus values for creating topdown bitmaps. - fixes loading of toolbar bitmaps in abiword

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Thu Nov 1 16:45:42 CET 2007


Author: gedmurphy
Date: Thu Nov  1 18:45:42 2007
New Revision: 30043

URL: http://svn.reactos.org/svn/reactos?rev=30043&view=rev
Log:
- don't pass minus values for creating topdown bitmaps.
- fixes loading of toolbar bitmaps in abiword

Modified:
    trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c

Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c?rev=30043&r1=30042&r2=30043&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c Thu Nov  1 18:45:42 2007
@@ -54,9 +54,9 @@
       return 0;
    }
 
-   WidthBytes = BITMAPOBJ_GetWidthBytes(Width, BitsPixel);
-
-   Size.cx = Width;
+   WidthBytes = BITMAPOBJ_GetWidthBytes(Width, Planes * BitsPixel);
+
+   Size.cx = abs(Width);
    Size.cy = abs(Height);
 
    /* Create the bitmap object. */
@@ -108,7 +108,7 @@
    {
       if (pUnsafeBits)
       {
-         UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * Height;
+         UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * abs(Height);
          ProbeForRead(pUnsafeBits, cjBits, 1);
       }
 
@@ -186,7 +186,7 @@
 	}
 	else
 	{
-		Bmp = IntGdiCreateBitmap(Width, Height, 1, Dc->w.bitsPerPixel, NULL);
+		Bmp = IntGdiCreateBitmap(abs(Width), abs(Height), 1, Dc->w.bitsPerPixel, NULL);
 	}
 
 	return Bmp;




More information about the Ros-diffs mailing list