Fix release build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-03-06 21:07:50 +00:00
parent 10d1f4131d
commit 3ca22d5e92
3 changed files with 16 additions and 0 deletions

View File

@@ -128,7 +128,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
wxBitmapRefData::wxBitmapRefData() wxBitmapRefData::wxBitmapRefData()
{ {
#ifdef __WXDEBUG__
m_selectedInto = NULL; m_selectedInto = NULL;
#endif
m_bitmapMask = NULL; m_bitmapMask = NULL;
m_hBitmap = (WXHBITMAP) NULL; m_hBitmap = (WXHBITMAP) NULL;
m_hasAlpha = FALSE; m_hasAlpha = FALSE;
@@ -1043,11 +1045,15 @@ wxMask *wxBitmap::GetMask() const
return GetBitmapData() ? GetBitmapData()->GetMask() : (wxMask *) NULL; return GetBitmapData() ? GetBitmapData()->GetMask() : (wxMask *) NULL;
} }
#ifdef __WXDEBUG__
wxDC *wxBitmap::GetSelectedInto() const wxDC *wxBitmap::GetSelectedInto() const
{ {
return GetBitmapData() ? GetBitmapData()->m_selectedInto : (wxDC *) NULL; return GetBitmapData() ? GetBitmapData()->m_selectedInto : (wxDC *) NULL;
} }
#endif
#if WXWIN_COMPATIBILITY_2_4 #if WXWIN_COMPATIBILITY_2_4
int wxBitmap::GetQuality() const int wxBitmap::GetQuality() const
@@ -1066,12 +1072,16 @@ bool wxBitmap::HasAlpha() const
// wxBitmap setters // wxBitmap setters
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifdef __WXDEBUG__
void wxBitmap::SetSelectedInto(wxDC *dc) void wxBitmap::SetSelectedInto(wxDC *dc)
{ {
if ( GetBitmapData() ) if ( GetBitmapData() )
GetBitmapData()->m_selectedInto = dc; GetBitmapData()->m_selectedInto = dc;
} }
#endif
#if wxUSE_PALETTE #if wxUSE_PALETTE
void wxBitmap::SetPalette(const wxPalette& palette) void wxBitmap::SetPalette(const wxPalette& palette)

View File

@@ -273,10 +273,12 @@ void wxDC::SelectOldObjects(WXHDC dc)
if (m_oldBitmap) if (m_oldBitmap)
{ {
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap); ::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
#ifdef __WXDEBUG__
if (m_selectedBitmap.Ok()) if (m_selectedBitmap.Ok())
{ {
m_selectedBitmap.SetSelectedInto(NULL); m_selectedBitmap.SetSelectedInto(NULL);
} }
#endif
} }
m_oldBitmap = 0; m_oldBitmap = 0;
if (m_oldPen) if (m_oldPen)

View File

@@ -104,7 +104,9 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap); ::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
if ( m_selectedBitmap.Ok() ) if ( m_selectedBitmap.Ok() )
{ {
#ifdef __WXDEBUG__
m_selectedBitmap.SetSelectedInto(NULL); m_selectedBitmap.SetSelectedInto(NULL);
#endif
m_selectedBitmap = wxNullBitmap; m_selectedBitmap = wxNullBitmap;
} }
} }
@@ -119,7 +121,9 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
if ( !hBmp ) if ( !hBmp )
return; return;
#ifdef __WXDEBUG__
m_selectedBitmap.SetSelectedInto(this); m_selectedBitmap.SetSelectedInto(this);
#endif
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp); hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
if ( !hBmp ) if ( !hBmp )