- don't pass minus values for creating topdown bitmaps.

- fixes loading of toolbar bitmaps in abiword

svn path=/trunk/; revision=30043
This commit is contained in:
Ged Murphy 2007-11-01 15:45:42 +00:00
parent 75d64c3e09
commit fa1e99d927

View file

@ -54,9 +54,9 @@ IntGdiCreateBitmap(
return 0; return 0;
} }
WidthBytes = BITMAPOBJ_GetWidthBytes(Width, BitsPixel); WidthBytes = BITMAPOBJ_GetWidthBytes(Width, Planes * BitsPixel);
Size.cx = Width; Size.cx = abs(Width);
Size.cy = abs(Height); Size.cy = abs(Height);
/* Create the bitmap object. */ /* Create the bitmap object. */
@ -108,7 +108,7 @@ NtGdiCreateBitmap(
{ {
if (pUnsafeBits) if (pUnsafeBits)
{ {
UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * Height; UINT cjBits = BITMAPOBJ_GetWidthBytes(Width, BitsPixel) * abs(Height);
ProbeForRead(pUnsafeBits, cjBits, 1); ProbeForRead(pUnsafeBits, cjBits, 1);
} }
@ -186,7 +186,7 @@ IntCreateCompatibleBitmap(
} }
else else
{ {
Bmp = IntGdiCreateBitmap(Width, Height, 1, Dc->w.bitsPerPixel, NULL); Bmp = IntGdiCreateBitmap(abs(Width), abs(Height), 1, Dc->w.bitsPerPixel, NULL);
} }
return Bmp; return Bmp;