From: Vadim Zeitlin Date: Sun, 18 Sep 2005 01:19:28 +0000 (+0000) Subject: get rid of wxClientDC::m_oldFont, it wasn't really used (this fixes crash introduced... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c74b77ed51e23e2a8374e047c7f9fe3fa855058b get rid of wxClientDC::m_oldFont, it wasn't really used (this fixes crash introduced by last change to this code) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/motif/dcclient.h b/include/wx/motif/dcclient.h index fa04c08521..8522c8e23b 100644 --- a/include/wx/motif/dcclient.h +++ b/include/wx/motif/dcclient.h @@ -168,6 +168,12 @@ protected: int m_currentStyle ; int m_currentFill ; int m_autoSetting ; // See comment in dcclient.cpp + + // this is useless and should be removed, kept for now just for backwards + // compatibility +#if wxCHECK_VERSION(2, 7, 0) + #error "Remove wxClientDC::m_oldFont" +#endif WXFont m_oldFont; }; diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 3ab64e3425..6bd956c0bd 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -199,24 +199,11 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_backgroundPixel = (int) gcvalues.background; - // Get the current Font so we can set it back later - XGCValues valReturn; - XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn); - m_oldFont = (WXFont) valReturn.font; - SetBackground(wxBrush(m_window->GetBackgroundColour(), wxSOLID)); } wxWindowDC::~wxWindowDC() { - if (m_gc && m_oldFont) - { - XSetFont ((Display*) m_display, (GC) m_gc, (Font) m_oldFont); - - if (m_window && m_window->GetBackingPixmap()) - XSetFont ((Display*) m_display,(GC) m_gcBacking, (Font) m_oldFont); - } - if (m_gc) XFreeGC ((Display*) m_display, (GC) m_gc); m_gc = (WXGC) 0; @@ -1415,13 +1402,6 @@ void wxWindowDC::SetFont( const wxFont &font ) if (!m_font.Ok()) { - if (m_oldFont) - { - XSetFont ((Display*) m_display, (GC) m_gc, (Font) m_oldFont); - - if (m_window && m_window->GetBackingPixmap()) - XSetFont ((Display*) m_display,(GC) m_gcBacking, (Font) m_oldFont); - } return; } diff --git a/src/motif/dcmemory.cpp b/src/motif/dcmemory.cpp index 98cd0efd3e..546dc4417c 100644 --- a/src/motif/dcmemory.cpp +++ b/src/motif/dcmemory.cpp @@ -55,10 +55,6 @@ wxMemoryDC::wxMemoryDC(void) m_backgroundPixel = (int) gcvalues.background; - // Get the current Font so we can set it back later - XGCValues valReturn; - XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn); - m_oldFont = (WXFont) valReturn.font; SetBrush (* wxWHITE_BRUSH); SetPen (* wxBLACK_PEN); SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); @@ -86,10 +82,6 @@ wxMemoryDC::wxMemoryDC( wxDC* dc ) m_backgroundPixel = (int) gcvalues.background; - // Get the current Font so we can set it back later - XGCValues valReturn; - XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn); - m_oldFont = (WXFont) valReturn.font; SetBrush (* wxWHITE_BRUSH); SetPen (* wxBLACK_PEN); }; @@ -124,11 +116,6 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) m_backgroundPixel = (int) gcvalues.background; m_ok = true; - // Get the current Font so we can set it back later - XGCValues valReturn; - XGetGCValues((Display*) m_display, (GC) m_gc, GCFont, &valReturn); - m_oldFont = (WXFont) valReturn.font; - SetBrush (* wxWHITE_BRUSH); SetPen (* wxBLACK_PEN); }