COW cleanup patch (1583966):
1. perform deep comparison for the classes for which it makes sense in the ports where this wasn't done yet 2. remove (shallow) comparison operators for the classes for which it does not make sense (such as wxBitmap) 3. makes wxBitmap use COW on all ports 4. adds wxObject::IsRefTo() 5. centralizes and improves COW docs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1066,16 +1066,6 @@ wxBitmap::~wxBitmap()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxBitmap::operator == ( const wxBitmap& bmp ) const
|
||||
{
|
||||
return m_refData == bmp.m_refData;
|
||||
}
|
||||
|
||||
bool wxBitmap::operator != ( const wxBitmap& bmp ) const
|
||||
{
|
||||
return m_refData != bmp.m_refData;
|
||||
}
|
||||
|
||||
bool wxBitmap::IsOk() const
|
||||
{
|
||||
return (m_refData != NULL) &&
|
||||
@@ -1114,6 +1104,7 @@ void wxBitmap::SetMask( wxMask *mask )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid bitmap") );
|
||||
|
||||
AllocExclusive();
|
||||
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
|
||||
|
||||
M_BMPDATA->m_mask = mask;
|
||||
@@ -1248,25 +1239,19 @@ void wxBitmap::SetPalette(const wxPalette& WXUNUSED(palette))
|
||||
|
||||
void wxBitmap::SetHeight( int height )
|
||||
{
|
||||
if (!m_refData)
|
||||
m_refData = new wxBitmapRefData();
|
||||
|
||||
AllocExclusive();
|
||||
M_BMPDATA->m_height = height;
|
||||
}
|
||||
|
||||
void wxBitmap::SetWidth( int width )
|
||||
{
|
||||
if (!m_refData)
|
||||
m_refData = new wxBitmapRefData();
|
||||
|
||||
AllocExclusive();
|
||||
M_BMPDATA->m_width = width;
|
||||
}
|
||||
|
||||
void wxBitmap::SetDepth( int depth )
|
||||
{
|
||||
if (!m_refData)
|
||||
m_refData = new wxBitmapRefData();
|
||||
|
||||
AllocExclusive();
|
||||
M_BMPDATA->m_bpp = depth;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
bool operator == (const wxBrushRefData& data) const
|
||||
{
|
||||
return (m_style == data.m_style &&
|
||||
m_stipple == data.m_stipple &&
|
||||
m_stipple.IsRefTo(&data.m_stipple) &&
|
||||
m_colour == data.m_colour);
|
||||
}
|
||||
|
||||
|
||||
@@ -316,16 +316,6 @@ wxCursor::~wxCursor()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxCursor::operator == ( const wxCursor& cursor ) const
|
||||
{
|
||||
return m_refData == cursor.m_refData;
|
||||
}
|
||||
|
||||
bool wxCursor::operator != ( const wxCursor& cursor ) const
|
||||
{
|
||||
return m_refData != cursor.m_refData;
|
||||
}
|
||||
|
||||
bool wxCursor::IsOk() const
|
||||
{
|
||||
return (m_refData != NULL);
|
||||
|
||||
Reference in New Issue
Block a user