m_pIDataObject = NULL;
}
-size_t wxDataObject::GetBufferOffset( const wxDataFormat& format )
+size_t wxDataObject::GetBufferOffset( const wxDataFormat& WXUNUSED(format) )
{
return sizeof(size_t);
}
const void* wxDataObject::GetSizeFromBuffer( const void* buffer, size_t* size,
- const wxDataFormat& format )
+ const wxDataFormat& WXUNUSED(format) )
{
size_t* p = (size_t*)buffer;
*size = *p;
}
void* wxDataObject::SetSizeInBuffer( void* buffer, size_t size,
- const wxDataFormat& format )
+ const wxDataFormat& WXUNUSED(format) )
{
size_t* p = (size_t*)buffer;
*p = size;
public:
CFSTR_SHELLURLDataObject() : wxCustomDataObject(CFSTR_SHELLURL) {}
protected:
- virtual size_t GetBufferOffset( const wxDataFormat& format )
+ virtual size_t GetBufferOffset( const wxDataFormat& WXUNUSED(format) )
{
return 0;
}
virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size,
- const wxDataFormat& format )
+ const wxDataFormat& WXUNUSED(format) )
{
// CFSTR_SHELLURL is _always_ ANSI text
*size = strlen( (const char*)buffer );
return buffer;
}
- virtual void* SetSizeInBuffer( void* buffer, size_t size,
- const wxDataFormat& format )
+ virtual void* SetSizeInBuffer( void* buffer, size_t WXUNUSED(size),
+ const wxDataFormat& WXUNUSED(format) )
{
return buffer;
}
// BITMAPINFO starts with BITMAPINFOHEADER followed by colour info
const BITMAPINFOHEADER *pbmih = &pbmi->bmiHeader;
+ // biClrUsed has the number of colors, unless it's 0
+ int numColors = pbmih->biClrUsed;
+ if (numColors==0)
+ {
+ numColors = wxGetNumOfBitmapColors(pbmih->biBitCount);
+ }
+
// offset of image from the beginning of the header
- DWORD ofs = wxGetNumOfBitmapColors(pbmih->biBitCount) * sizeof(RGBQUAD);
+ DWORD ofs = numColors * sizeof(RGBQUAD);
void *image = (char *)pbmih + sizeof(BITMAPINFOHEADER) + ofs;
ScreenHDC hdc;