X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/81ba2662b188f62ee9a04501d89ce83be1bbec54..4bc0f25ed7eefb4a6fbeb61189a4c12023b9730f:/src/msw/icon.cpp?ds=sidebyside diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 6a7783ebf5..564a07d875 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "icon.h" #endif @@ -102,6 +102,25 @@ wxIcon::~wxIcon() { } +wxObjectRefData *wxIcon::CloneRefData(const wxObjectRefData *dataOrig) const +{ + const wxIconRefData * + data = wx_static_cast(const wxIconRefData *, dataOrig); + if ( !data ) + return NULL; + + wxIcon *self = wx_const_cast(wxIcon *, this); + self->UnRef(); + self->m_refData = new wxIconRefData(*data); + + if ( data->m_hIcon ) + { + ::CopyIcon(HICON(data->m_hIcon)); + } + + return m_refData; +} + void wxIcon::CopyFromBitmap(const wxBitmap& bmp) { #ifndef __WXMICROWIN__ @@ -135,7 +154,7 @@ bool wxIcon::LoadFile(const wxString& filename, if ( !handler ) { // say something? - return FALSE; + return false; } return handler->Load(this, filename, type, desiredWidth, desiredHeight);