1 Index: vcl/source/gdi/bitmap2.cxx
2 ===================================================================
3 RCS file: /cvs/gsl/vcl/source/gdi/bitmap2.cxx,v
4 retrieving revision 1.14
5 diff -u -r1.14 bitmap2.cxx
6 --- vcl/source/gdi/bitmap2.cxx 17 Sep 2006 11:57:13 -0000 1.14
7 +++ vcl/source/gdi/bitmap2.cxx 1 Feb 2007 15:36:29 -0000
10 const USHORT nBitCount( discretizeBitcount(aHeader.nBitCount) );
12 - const Size aSizePixel( aHeader.nWidth, aHeader.nHeight );
13 + const Size aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) );
14 BitmapPalette aDummyPal;
15 Bitmap aNewBmp( aSizePixel, nBitCount, &aDummyPal );
16 BitmapWriteAccess* pAcc = aNewBmp.AcquireWriteAccess();
18 Fraction( 1000, aHeader.nYPelsPerMeter ) );
20 aNewBmp.SetPrefMapMode( aMapMode );
21 - aNewBmp.SetPrefSize( Size( aHeader.nWidth, aHeader.nHeight ) );
22 + aNewBmp.SetPrefSize( Size( aHeader.nWidth, abs(aHeader.nHeight) ) );
29 rIStm >> rHeader.nWidth;
30 - rIStm >> rHeader.nHeight;
31 + rIStm >> rHeader.nHeight; //rHeader.nHeight=abs(rHeader.nHeight);
32 rIStm >> rHeader.nPlanes;
33 rIStm >> rHeader.nBitCount;
34 rIStm >> rHeader.nCompression;
36 if( rHeader.nColsUsed && rHeader.nBitCount > 8 )
37 rIStm.SeekRel( rHeader.nColsUsed * ( ( rHeader.nSize != DIBCOREHEADERSIZE ) ? 4 : 3 ) );
39 - rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth );
40 + if (rHeader.nHeight>0) {
41 + rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth );
43 + for(int i=abs(rHeader.nHeight)-1;i>=0;i--) {
44 + rIStm.Read( ((char*)rAcc.GetBuffer())+(nAlignedWidth*i), nAlignedWidth );
53 const long nWidth = rHeader.nWidth;
54 - const long nHeight = rHeader.nHeight;
55 + const long nHeight = abs(rHeader.nHeight);
56 BYTE* pBuf = new BYTE[ nAlignedWidth ];
58 // true color DIB's can have a (optimization) palette
60 BitmapWriteAccess& rAcc, BOOL bRLE4 )
62 Scanline pRLE = pBuffer;
63 - long nY = rHeader.nHeight - 1L;
64 + long nY = abs(rHeader.nHeight) - 1L;
65 const ULONG nWidth = rAcc.Width();