From fce40eebe3ecce9fea24cc80aeae7473536c181b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 9 Apr 2003 01:06:42 +0000 Subject: [PATCH] MOre wxSTC tweaks and a buffer overflow fix too. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20091 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/PlatWX.cpp | 8 +++++--- contrib/src/stc/gen_iface.py | 4 ++-- contrib/src/stc/stc.cpp | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 5297a9adf6..d4519322d6 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -603,8 +603,10 @@ Window::~Window() { } void Window::Destroy() { - if (id) + if (id) { + Show(FALSE); GETWIN(id)->Destroy(); + } id = 0; } @@ -736,7 +738,7 @@ public: SetBackgroundColour(*wxBLUE); lv = new wxSTCListBox(this, id, wxDefaultPosition, wxDefaultSize, - wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER); + wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxNO_BORDER); lv->SetCursor(wxCursor(wxCURSOR_ARROW)); lv->InsertColumn(0, wxEmptyString); lv->InsertColumn(1, wxEmptyString); @@ -770,7 +772,7 @@ public: wxSize sz = GetClientSize(); lv->SetSize(1, 1, sz.x-2, sz.y-2); lv->SetColumnWidth(0, IconWidth()+4); - lv->SetColumnWidth(1, sz.x - lv->GetColumnWidth(0) - + lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X)); event.Skip(); } diff --git a/contrib/src/stc/gen_iface.py b/contrib/src/stc/gen_iface.py index d83f97aa27..c9cda454ca 100644 --- a/contrib/src/stc/gen_iface.py +++ b/contrib/src/stc/gen_iface.py @@ -191,7 +191,7 @@ methodOverrideMap = { size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); - buff[len+1] = 0; + buff[len] = 0; SendMsg(%s, markerNumber, (long)buff); delete [] buff; ''', @@ -285,7 +285,7 @@ methodOverrideMap = { size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); - buff[len+1] = 0; + buff[len] = 0; SendMsg(%s, type, (long)buff); delete [] buff; ''', diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index 6349ed51da..aa516bb4c5 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -467,7 +467,7 @@ void wxStyledTextCtrl::MarkerDefineBitmap(int markerNumber, const wxBitmap& bmp) size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); - buff[len+1] = 0; + buff[len] = 0; SendMsg(2049, markerNumber, (long)buff); delete [] buff; @@ -845,7 +845,7 @@ void wxStyledTextCtrl::RegisterImage(int type, const wxBitmap& bmp) { size_t len = strm.GetSize(); char* buff = new char[len+1]; strm.CopyTo(buff, len); - buff[len+1] = 0; + buff[len] = 0; SendMsg(2405, type, (long)buff); delete [] buff;