X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..fef5c55604e20e2a90843a2278b1f5c8c817dcee:/src/x11/textctrl.cpp?ds=sidebyside diff --git a/src/x11/textctrl.cpp b/src/x11/textctrl.cpp index 84b9ae0290..3b778c72a9 100644 --- a/src/x11/textctrl.cpp +++ b/src/x11/textctrl.cpp @@ -157,8 +157,6 @@ void wxTextCtrl::Init() m_editable = TRUE; m_modified = FALSE; - m_undos.DeleteContents( TRUE ); - m_lang = wxSOURCE_LANG_NONE; m_capturing = FALSE; @@ -202,6 +200,11 @@ wxTextCtrl::wxTextCtrl( wxWindow *parent, Create( parent, id, value, pos, size, style, validator, name ); } +wxTextCtrl::~wxTextCtrl() +{ + WX_CLEAR_LIST(wxList, m_undos); +} + bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value, @@ -218,7 +221,7 @@ bool wxTextCtrl::Create( wxWindow *parent, style |= wxALWAYS_SHOW_SB; wxTextCtrlBase::Create( parent, id, pos /* wxDefaultPosition */, size, - style|wxVSCROLL|wxHSCROLL|wxNO_FULL_REPAINT_ON_RESIZE ); + style | wxVSCROLL | wxHSCROLL); SetBackgroundColour( *wxWHITE ); @@ -398,7 +401,7 @@ void wxTextCtrl::Clear() SetScrollbars( m_charWidth, m_lineHeight, 0, 0, 0, 0 ); Refresh(); - m_undos.Clear(); + WX_CLEAR_LIST(wxList, m_undos); } void wxTextCtrl::Replace(long from, long to, const wxString& value) @@ -795,12 +798,13 @@ void wxTextCtrl::Undo() { if (m_undos.GetCount() == 0) return; - wxList::Node *node = m_undos.Item( m_undos.GetCount()-1 ); + wxList::compatibility_iterator node = m_undos.Item( m_undos.GetCount()-1 ); wxSourceUndoStep *undo = (wxSourceUndoStep*) node->GetData(); undo->Undo(); - - delete node; + + delete undo; + m_undos.Erase( node ); m_modified = TRUE; }