]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dcbufcmn.cpp
minimize searching for tlw parent, remove useless code
[wxWidgets.git] / src / common / dcbufcmn.cpp
index b38b4f1f67921c65093f3bcbc69c3517a42b30e8..8c6c25b40e18d86453f2a827b7f07e171edbe8f5 100644 (file)
@@ -34,6 +34,9 @@
 // implementation
 // ============================================================================
 
+IMPLEMENT_DYNAMIC_CLASS(wxBufferedDC,wxMemoryDC)
+IMPLEMENT_ABSTRACT_CLASS(wxBufferedPaintDC,wxBufferedDC)
+
 // ----------------------------------------------------------------------------
 // wxSharedDCBufferManager: helper class maintaining backing store bitmap
 // ----------------------------------------------------------------------------
@@ -56,6 +59,14 @@ public:
                     h > ms_buffer->GetHeight() )
         {
             delete ms_buffer;
+
+            // we must always return a valid bitmap but creating a bitmap of
+            // size 0 would fail, so create a 1*1 bitmap in this case
+            if ( !w )
+                w = 1;
+            if ( !h )
+                h = 1;
+
             ms_buffer = new wxBitmap(w, h);
         }