]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dcclient.cpp
OpenVMS update
[wxWidgets.git] / src / msw / dcclient.cpp
index ad83a7b49f30bebbbe258440281eda608d8ba339..75c1c9a550515db4a5e844eacc415d1a6b8d2300 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        dcclient.cpp
+// Name:        src/msw/dcclient.cpp
 // Purpose:     wxClientDC class
 // Author:      Julian Smart
 // Modified by:
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "dcclient.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
     #pragma hdrstop
 #endif
 
-#include "wx/string.h"
-#include "wx/log.h"
-#include "wx/window.h"
+#include "wx/dcclient.h"
 
-#include "wx/msw/private.h"
+#ifndef WX_PRECOMP
+    #include "wx/string.h"
+    #include "wx/log.h"
+    #include "wx/window.h"
+#endif
 
-#include "wx/dcclient.h"
+#include "wx/msw/private.h"
 
 // ----------------------------------------------------------------------------
 // array/list types
@@ -56,7 +54,7 @@ struct WXDLLEXPORT wxPaintDCInfo
 
 #include "wx/arrimpl.cpp"
 
-WX_DEFINE_OBJARRAY(wxArrayDCInfo);
+WX_DEFINE_OBJARRAY(wxArrayDCInfo)
 
 // ----------------------------------------------------------------------------
 // macros
@@ -240,10 +238,16 @@ wxPaintDC::wxPaintDC(wxWindow *canvas)
             ms_cache.Add(new wxPaintDCInfo(m_canvas, this));
     }
 
-    // (re)set the DC parameters.
     // Note: at this point m_hDC can be NULL under MicroWindows, when dragging.
-    if (GetHDC())
-        InitDC();
+    if (!GetHDC())
+        return;
+
+    // (re)set the DC parameters.
+    InitDC();
+
+    // the HDC can have a clipping box (which we didn't set), make sure our
+    // DoGetClippingBox() checks for it
+    m_clipping = true;
 }
 
 wxPaintDC::~wxPaintDC()
@@ -257,7 +261,7 @@ wxPaintDC::~wxPaintDC()
 
         wxCHECK_RET( info, wxT("existing DC should have a cache entry") );
 
-        if ( !--info->count )
+        if ( --info->count == 0 )
         {
             ::EndPaint(GetHwndOf(m_canvas), &g_paintStruct);
 
@@ -342,7 +346,7 @@ wxPaintDCEx::~wxPaintDCEx()
 
     wxCHECK_RET( info, wxT("existing DC should have a cache entry") );
 
-    if ( !--info->count )
+    if ( --info->count == 0 )
     {
         RestoreDC((HDC) m_hDC, saveState);
         ms_cache.RemoveAt(index);
@@ -357,4 +361,3 @@ wxPaintDCEx::~wxPaintDCEx()
     // prevent the base class dtor from ReleaseDC()ing it again
     m_hDC = 0;
 }
-