X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/888dde65f43d5f57e8fb2028b27191cca1741403..ba8c878f957da36c14879b747a2d54d7fe01baa8:/src/msw/bitmap.cpp diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index d06251a599..222cb4c40b 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -211,7 +211,7 @@ wxBitmapRefData::wxBitmapRefData(const wxBitmapRefData& data) m_bitmapMask = new wxMask(*data.m_bitmapMask); // FIXME: we don't copy m_hBitmap currently but we should, see wxBitmap:: - // CloneRefData() + // CloneGDIRefData() wxASSERT_MSG( !data.m_isDIB, _T("can't copy bitmap locked for raw access!") ); @@ -250,7 +250,7 @@ wxGDIImageRefData *wxBitmap::CreateData() const return new wxBitmapRefData; } -wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *dataOrig) const +wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *dataOrig) const { const wxBitmapRefData * data = wx_static_cast(const wxBitmapRefData *, dataOrig); @@ -277,16 +277,17 @@ wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *dataOrig) const self->m_refData = new wxBitmapRefData(*data); } + wxBitmapRefData * const + selfdata = wx_static_cast(wxBitmapRefData *, m_refData); + // copy also the mask wxMask * const maskSrc = data->GetMask(); if ( maskSrc ) { - wxBitmapRefData *selfdata = wx_static_cast(wxBitmapRefData *, m_refData); - selfdata->SetMask(new wxMask(*maskSrc)); } - return m_refData; + return selfdata; } bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon,