Replace many identical wxBitmap::CopyFromIcon() with a single one
Define CopyFromIcon() directly in wxBitmapBase for the non-MSW ports, as it was implemented exactly in the same way in all ports using this class anyhow. This means this function is not virtual any longer, but this shouldn't be a problem as it was never supposed to be overridden in application code and this couldn't be done with wxMSW, where it never was virtual in the first place, anyhow. No real changes, just a simplification.
This commit is contained in:
@@ -223,7 +223,7 @@ public:
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon) = 0;
|
||||
bool CopyFromIcon(const wxIcon& icon);
|
||||
|
||||
// implementation:
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
|
@@ -63,9 +63,6 @@ public:
|
||||
virtual void SetPalette(const wxPalette& palette);
|
||||
#endif
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon);
|
||||
|
||||
static void InitStandardHandlers();
|
||||
|
||||
// raw bitmap access support functions
|
||||
|
@@ -103,9 +103,6 @@ public:
|
||||
wxImage ConvertToImage() const wxOVERRIDE;
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon) wxOVERRIDE;
|
||||
|
||||
wxMask *GetMask() const wxOVERRIDE;
|
||||
void SetMask( wxMask *mask ) wxOVERRIDE;
|
||||
|
||||
|
@@ -88,9 +88,6 @@ public:
|
||||
|
||||
wxImage ConvertToImage() const;
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon);
|
||||
|
||||
wxMask *GetMask() const;
|
||||
void SetMask( wxMask *mask );
|
||||
|
||||
|
@@ -165,9 +165,6 @@ public:
|
||||
wxBitmapRefData *GetBitmapData()
|
||||
{ return (wxBitmapRefData *)m_refData; }
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon) wxOVERRIDE;
|
||||
|
||||
int GetWidth() const wxOVERRIDE;
|
||||
int GetHeight() const wxOVERRIDE;
|
||||
int GetDepth() const wxOVERRIDE;
|
||||
|
@@ -61,9 +61,6 @@ public:
|
||||
virtual void SetPalette(const wxPalette& palette) wxOVERRIDE;
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon) wxOVERRIDE;
|
||||
|
||||
// implementation:
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
wxDEPRECATED(virtual void SetHeight(int height) wxOVERRIDE);
|
||||
|
@@ -98,9 +98,6 @@ public:
|
||||
bool CreateFromImage(const wxImage& image, int depth = -1);
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon);
|
||||
|
||||
wxMask *GetMask() const;
|
||||
void SetMask( wxMask *mask );
|
||||
|
||||
|
@@ -196,6 +196,12 @@ public:
|
||||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule);
|
||||
|
||||
bool wxBitmapBase::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
*this = icon;
|
||||
return IsOk();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Trivial implementations of scale-factor related functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -603,12 +603,6 @@ void wxBitmap::SetMask(wxMask *mask)
|
||||
M_BITMAP->m_mask = mask;
|
||||
}
|
||||
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
*this = *((wxBitmap*)(&icon));
|
||||
return true;
|
||||
}
|
||||
|
||||
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
|
||||
{
|
||||
wxCHECK_MSG( IsOk() &&
|
||||
|
@@ -988,12 +988,6 @@ void wxBitmap::SetMask( wxMask *mask )
|
||||
}
|
||||
}
|
||||
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
*this = icon;
|
||||
return IsOk();
|
||||
}
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
bool wxBitmap::CreateScaled(int w, int h, int depth, double scale)
|
||||
{
|
||||
|
@@ -1192,12 +1192,6 @@ void wxBitmap::SetMask( wxMask *mask )
|
||||
M_BMPDATA->m_mask = mask;
|
||||
}
|
||||
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
*this = icon;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||
{
|
||||
wxCHECK_MSG( IsOk() &&
|
||||
|
@@ -782,12 +782,6 @@ wxBitmapRefData::~wxBitmapRefData()
|
||||
// wxBitmap
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
*this = icon;
|
||||
return IsOk();
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits)
|
||||
{
|
||||
m_refData = new wxBitmapRefData( the_width , the_height , no_bits ) ;
|
||||
|
@@ -372,13 +372,6 @@ void wxBitmap::SetPalette(const wxPalette& WXUNUSED(palette))
|
||||
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
*this = icon;
|
||||
return IsOk();
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
void wxBitmap::SetHeight(int height)
|
||||
{
|
||||
|
@@ -993,12 +993,6 @@ void wxBitmap::SetMask( wxMask *mask )
|
||||
M_BMPDATA->m_mask = mask;
|
||||
}
|
||||
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
*this = icon;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||
{
|
||||
wxCHECK_MSG( IsOk() &&
|
||||
|
Reference in New Issue
Block a user