wxBitmapRefData(const wxBitmapRefData& data)
{
- if ( data.m_surface )
- m_surface = data.m_surface->Clone();
+ m_surface = data.m_surface ? data.m_surface->Clone() : NULL;
m_mask = data.m_mask ? new wxMask(*data.m_mask) : NULL;
#if wxUSE_PALETTE
#endif
}
- ~wxBitmapRefData()
+ virtual ~wxBitmapRefData()
{
delete m_mask;
#if wxUSE_PALETTE
wxFAIL_MSG( _T("not implemented") );
}
-bool wxBitmap::Ok() const
+bool wxBitmap::IsOk() const
{
return (m_refData != NULL && M_BITMAP->m_surface);
}
-bool wxBitmap::operator==(const wxBitmap& bmp) const
-{
- // FIXME: is this the right way to compare bitmaps?
- return (m_refData == bmp.m_refData);
-}
-
int wxBitmap::GetHeight() const
{
wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
{
wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+ AllocExclusive();
delete M_BITMAP->m_mask;
M_BITMAP->m_mask = mask;
}
wxCHECK_RET( Ok(), wxT("invalid bitmap") );
wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") );
+ AllocExclusive();
delete M_BITMAP->m_palette;
M_BITMAP->m_palette = NULL;