fixed CopyFromBitmap() for shared wxIcon objects by adding CloneRefData() implementation (patch 1026453)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-09-11 20:26:44 +00:00
parent 0a7b481fee
commit 9d769508fb
2 changed files with 21 additions and 0 deletions

View File

@@ -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);
lf->UnRef();
lf->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__