X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/196fc5f2883badc4c5bcf33a52185e6d7531d853..ef8f6d9590b7f9c73dcdfac244647c6e88ebd2ec:/src/msw/dcmemory.cpp?ds=sidebyside diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index 1ad90bbb83..c84983ad85 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -40,25 +40,25 @@ IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxMSWDCImpl) -wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner ) +wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner ) : wxMSWDCImpl( owner ) { - CreateCompatible(NULL); - Init(); + CreateCompatible(NULL); + Init(); } -wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) - : wxMSWDCImpl( owner ) -{ - CreateCompatible(NULL); - Init(); +wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) + : wxMSWDCImpl( owner ) +{ + CreateCompatible(NULL); + Init(); DoSelect(bitmap); } wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ) - : wxMSWDCImpl( owner ) + : wxMSWDCImpl( owner ) { - wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") ); + wxCHECK_RET( dc, wxT("NULL dc in wxMemoryDC ctor") ); CreateCompatible(dc); @@ -80,9 +80,9 @@ void wxMemoryDCImpl::Init() bool wxMemoryDCImpl::CreateCompatible(wxDC *dc) { - wxDCImpl *impl = dc->GetImpl(); + wxDCImpl *impl = dc ? dc->GetImpl() : NULL ; wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl ); - if (!msw_impl) + if ( dc && !msw_impl) { m_ok = false; return false; @@ -106,9 +106,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) ::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap); if ( m_selectedBitmap.Ok() ) { -#ifdef __WXDEBUG__ m_selectedBitmap.SetSelectedInto(NULL); -#endif m_selectedBitmap = wxNullBitmap; } } @@ -123,9 +121,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) if ( !hBmp ) return; -#ifdef __WXDEBUG__ m_selectedBitmap.SetSelectedInto(GetOwner()); -#endif hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp); if ( !hBmp )