X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a9a3ce9a39580a537b1cd25b4e207ac760075d6..c746b747074dba438ac1c06b612184aaad7c7dc6:/include/wx/dcbuffer.h diff --git a/include/wx/dcbuffer.h b/include/wx/dcbuffer.h index 5b553769b7..bce4780cc0 100644 --- a/include/wx/dcbuffer.h +++ b/include/wx/dcbuffer.h @@ -122,13 +122,13 @@ private: void InitCommon(wxDC *dc, int style) { wxASSERT_MSG( !m_dc, _T("wxBufferedDC already initialised") ); - wxCHECK_RET( dc, _T("can't associate NULL DC with wxBufferedDC") ); m_dc = dc; m_style = style; // inherit the same layout direction as the original DC - SetLayoutDirection(dc->GetLayoutDirection()); + if (dc && dc->IsOk()) + SetLayoutDirection(dc->GetLayoutDirection()); } // check that the bitmap is valid and use it @@ -169,7 +169,7 @@ public: if (style & wxBUFFER_VIRTUAL_AREA) window->PrepareDC( m_paintdc ); - if( buffer != wxNullBitmap ) + if( buffer.IsOk() ) Init(&m_paintdc, buffer, style); else Init(&m_paintdc, window->GetClientSize(), style);