X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/39c0acb66674c5e0424633cf162e6c10c92178d4..b77b87881bae2e6306366d79e7fe160334b3d4a2:/src/stc/stc.cpp.in diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 4cc177306f..d94ba9ac68 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -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 @@ -349,20 +349,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 }