Compilation fixes for wxUSE_STL == 1 and for wxUSE_UNICODE == 1.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-11-23 08:16:36 +00:00
parent 1a6d9c7680
commit 8e5ec9cc58
4 changed files with 16 additions and 32 deletions

View File

@@ -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
}