]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dcbuffer.h
Initialise all variables
[wxWidgets.git] / include / wx / dcbuffer.h
index 5b553769b70687d2505f472939671b59cf20fcfc..bce4780cc0854781b7fccf4bc888012319024484 100644 (file)
@@ -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);