Remove wxHAS_PAINT_DEBUG and code guarded by it
This doesn't seem to actually be doing anything useful, as it only checks that wxPaintDCImpl is not created without creating wxPaintDC which is impossible to do accidentally anyhow. This will be replaced by a more useful check in the next commit.
This commit is contained in:
@@ -2335,39 +2335,15 @@ private:
|
||||
wxEVT_NC_PAINT
|
||||
*/
|
||||
|
||||
#if wxDEBUG_LEVEL && defined(__WXMSW__)
|
||||
#define wxHAS_PAINT_DEBUG
|
||||
|
||||
// see comments in src/msw/dcclient.cpp where g_isPainting is defined
|
||||
extern WXDLLIMPEXP_CORE int g_isPainting;
|
||||
#endif // debug
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPaintEvent : public wxEvent
|
||||
{
|
||||
public:
|
||||
wxPaintEvent(int Id = 0)
|
||||
: wxEvent(Id, wxEVT_PAINT)
|
||||
{
|
||||
#ifdef wxHAS_PAINT_DEBUG
|
||||
// set the internal flag for the duration of redrawing
|
||||
g_isPainting++;
|
||||
#endif // debug
|
||||
}
|
||||
|
||||
// default copy ctor and dtor are normally fine, we only need them to keep
|
||||
// g_isPainting updated in debug build
|
||||
#ifdef wxHAS_PAINT_DEBUG
|
||||
wxPaintEvent(const wxPaintEvent& event)
|
||||
: wxEvent(event)
|
||||
{
|
||||
g_isPainting++;
|
||||
}
|
||||
|
||||
virtual ~wxPaintEvent()
|
||||
{
|
||||
g_isPainting--;
|
||||
}
|
||||
#endif // debug
|
||||
// default copy ctor and dtor are fine
|
||||
|
||||
virtual wxEvent *Clone() const wxOVERRIDE { return new wxPaintEvent(*this); }
|
||||
|
||||
|
@@ -138,18 +138,6 @@ PaintDCInfos gs_PaintDCInfos;
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global variables
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef wxHAS_PAINT_DEBUG
|
||||
// a global variable which we check to verify that wxPaintDC are only
|
||||
// created in response to WM_PAINT message - doing this from elsewhere is a
|
||||
// common programming error among wxWidgets programmers and might lead to
|
||||
// very subtle and difficult to debug refresh/repaint bugs.
|
||||
int g_isPainting = 0;
|
||||
#endif // wxHAS_PAINT_DEBUG
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
@@ -269,15 +257,6 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) :
|
||||
{
|
||||
wxCHECK_RET( window, wxT("NULL canvas in wxPaintDCImpl ctor") );
|
||||
|
||||
#ifdef wxHAS_PAINT_DEBUG
|
||||
if ( g_isPainting <= 0 )
|
||||
{
|
||||
wxFAIL_MSG( wxT("wxPaintDCImpl may be created only in EVT_PAINT handler!") );
|
||||
|
||||
return;
|
||||
}
|
||||
#endif // wxHAS_PAINT_DEBUG
|
||||
|
||||
// see comments in src/msw/window.cpp where this is defined
|
||||
extern wxStack<bool> wxDidCreatePaintDC;
|
||||
|
||||
|
Reference in New Issue
Block a user