Index: cairo_devicehelper.cxx =================================================================== RCS file: /cvs/gsl/canvas/source/cairo/cairo_devicehelper.cxx,v retrieving revision 1.3 diff -u -p -r1.3 cairo_devicehelper.cxx --- canvas/source/cairo/cairo_devicehelper.cxx 22 Mar 2006 11:00:26 -0000 1.3 +++ canvas/source/cairo/cairo_devicehelper.cxx 9 Aug 2006 16:32:13 -0000 @@ -375,7 +375,19 @@ namespace cairocanvas Surface* DeviceHelper::getSurface( BitmapSystemData& rData, const Size& rSize ) { +#ifdef CAIRO_HAS_WIN32_SURFACE + if (rData.pDIB != NULL) { + // Using cairo will not work anyway, as most (?) DIBs that come here + // will be upside-down and different order of colour channels + // compared to what cairo expects. + return NULL; + } +#endif - return new Surface ( mpSysData, &rData, rSize.Width(), rSize.Height() ); + OSL_TRACE( "requested size: %d x %d available size: %d x %d", rSize.Width (), rSize.Height (), rData.mnWidth, rData.mnHeight ); + if ( rData.mnWidth == rSize.Width() && rData.mnHeight == rSize.Height() ) + return new Surface ( mpSysData, &rData, rSize.Width(), rSize.Height() ); + else + return NULL; } void DeviceHelper::flush()