1 Index: vcl/unx/source/gdi/salgdi2.cxx
2 ===================================================================
3 RCS file: /cvs/gsl/vcl/unx/source/gdi/salgdi2.cxx,v
4 retrieving revision 1.18
5 diff -u -p -u -r1.18 salgdi2.cxx
6 --- vcl/unx/source/gdi/salgdi2.cxx 10 Jun 2003 14:31:08 -0000 1.18
7 +++ vcl/unx/source/gdi/salgdi2.cxx 14 Oct 2003 13:12:49 -0000
8 @@ -775,10 +775,13 @@ void SalGraphics::DrawBitmap( const SalT
9 XGCValues aOldVal, aNewVal;
10 int nValues = GCForeground | GCBackground;
12 - // set foreground/background values for 1Bit bitmaps
13 - XGetGCValues( pXDisp, aGC, nValues, &aOldVal );
14 - aNewVal.foreground = rColMap.GetWhitePixel(), aNewVal.background = rColMap.GetBlackPixel();
15 - XChangeGC( pXDisp, aGC, nValues, &aNewVal );
16 + if( rSalBitmap.GetBitCount() == 1 )
18 + // set foreground/background values for 1Bit bitmaps
19 + XGetGCValues( pXDisp, aGC, nValues, &aOldVal );
20 + aNewVal.foreground = rColMap.GetWhitePixel(), aNewVal.background = rColMap.GetBlackPixel();
21 + XChangeGC( pXDisp, aGC, nValues, &aNewVal );
24 #if defined(_USE_PRINT_EXTENSION_)
25 rSalBitmap.ImplDraw( pSalDisp, aDrawable, nDepth, *pPosAry, aGC );
26 @@ -786,7 +789,8 @@ void SalGraphics::DrawBitmap( const SalT
27 rSalBitmap.ImplDraw( aDrawable, nDepth, *pPosAry, aGC );
30 - XChangeGC( pXDisp, aGC, nValues, &aOldVal );
31 + if( rSalBitmap.GetBitCount() == 1 )
32 + XChangeGC( pXDisp, aGC, nValues, &aOldVal );
35 #ifndef _USE_PRINT_EXTENSION_
36 @@ -1058,12 +1062,7 @@ SalBitmap *SalGraphics::GetBitmap( long
37 if( &_GetDisplay()->GetColormap() != &_GetColormap() )
41 -#if defined(_USE_PRINT_EXTENSION_)
42 - pSalBitmap->ImplCreateFromDrawable( _GetDisplay(), _GetDrawable(), nBitCount, nX, nY, nDX, nDY );
44 - pSalBitmap->ImplCreateFromDrawable( _GetDrawable(), nBitCount, nX, nY, nDX, nDY );
46 + pSalBitmap->ImplCreateLocalFromDrawable( _GetDrawable(), nBitCount, nX, nY, nDX, nDY );
49 #ifndef _USE_PRINT_EXTENSION_
50 Index: vcl/unx/inc/salbmp.hxx
51 ===================================================================
52 RCS file: /cvs/gsl/vcl/unx/inc/salbmp.hxx,v
53 retrieving revision 1.3
54 diff -u -p -u -r1.3 salbmp.hxx
55 --- vcl/unx/inc/salbmp.hxx 29 Aug 2001 16:14:00 -0000 1.3
56 +++ vcl/unx/inc/salbmp.hxx 14 Oct 2003 13:13:18 -0000
57 @@ -123,6 +124,12 @@ public:
59 long nWidth, long nHeight );
61 + BOOL ImplCreateLocalFromDrawable(
63 + long nDrawableDepth,
65 + long nWidth, long nHeight );
67 XImage* ImplCreateXImage(
68 SalDisplay* pSalDisp, long nDepth,
69 const SalTwoRect& rTwoRect ) const;
70 Index: vcl/unx/source/gdi/salbmp.cxx
71 ===================================================================
72 RCS file: /cvs/gsl/vcl/unx/source/gdi/salbmp.cxx,v
73 retrieving revision 1.8
74 diff -u -p -u -r1.8 salbmp.cxx
75 --- vcl/unx/source/gdi/salbmp.cxx 11 Sep 2001 15:52:22 -0000 1.8
76 +++ vcl/unx/source/gdi/salbmp.cxx 14 Oct 2003 13:13:48 -0000
77 @@ -502,6 +506,17 @@ BOOL SalBitmap::ImplCreateFromDrawable(
78 // -----------------------------------------------------------------------------
81 +BOOL SalBitmap::ImplCreateLocalFromDrawable( Drawable aDrawable, long nDrawableDepth,
82 + long nX, long nY, long nWidth, long nHeight )
86 + if( aDrawable && nWidth && nHeight && nDrawableDepth )
87 + mpDIB = ImplCreateDIB( aDrawable, nDrawableDepth, nX, nY, nWidth, nHeight );
89 + return( mpDIB != NULL );
93 SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow)