]> git.saurik.com Git - wxWidgets.git/commitdiff
Compilation fixes for wxUSE_STL == 1 and for wxUSE_UNICODE == 1.
authorMattia Barbon <mbarbon@cpan.org>
Sun, 23 Nov 2003 08:16:36 +0000 (08:16 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Sun, 23 Nov 2003 08:16:36 +0000 (08:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/src/stc/stc.cpp
contrib/src/stc/stc.cpp.in
src/stc/stc.cpp
src/stc/stc.cpp.in

index ab42de2dfe374631446818f9d109e8cdc3cd0748..93a193a70c8503ef67687156fb027c2218738fb7 100644 (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
         }
index 4cc177306fdeb4d35c55fb4386947b63d120edd8..9b9825a9db30bf18bf03efcd321e42b49673e33c 100644 (file)
@@ -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
         }
index ab42de2dfe374631446818f9d109e8cdc3cd0748..93a193a70c8503ef67687156fb027c2218738fb7 100644 (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
         }
index 4cc177306fdeb4d35c55fb4386947b63d120edd8..9b9825a9db30bf18bf03efcd321e42b49673e33c 100644 (file)
@@ -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
         }