X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/39c0acb66674c5e0424633cf162e6c10c92178d4..d1a6e2b7a103d761fbc15e0e9c1c20ab53a849d9:/contrib/src/stc/stc.cpp diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index ab42de2dfe..a9ca85c5c1 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -151,7 +151,7 @@ void wxStyledTextCtrl::Create(wxWindow *parent, const wxString& name) { wxControl::Create(parent, id, pos, size, - style | wxVSCROLL | wxHSCROLL | wxWANTS_CHARS | wxCLIP_CHILDREN, + style | wxWANTS_CHARS | wxCLIP_CHILDREN, wxDefaultValidator, name); #ifdef LINK_LEXERS @@ -2144,20 +2144,16 @@ bool wxStyledTextCtrl::LoadFile(const wxString& filename) if (file.IsOpened()) { wxString contents; -#if wxUSE_UNICODE - wxMemoryBuffer buffer; -#else - wxString buffer; -#endif off_t len = file.Length(); if (len > 0) { - void *bufptr = buffer.GetWriteBuf(len); - success = (file.Read(bufptr, len) == len); - buffer.UngetWriteBuf(len); #if wxUSE_UNICODE + wxMemoryBuffer buffer(len); + success = (file.Read(buffer.GetData(), len) == len); contents = wxString(buffer, *wxConvCurrent); #else + wxString buffer; + success = (file.Read(wxStringBuffer(buffer, len), len) == len); contents = buffer; #endif }