]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/datstrm.cpp
Don't use "Cancel" button in the about dialog of the listctrl sample.
[wxWidgets.git] / src / common / datstrm.cpp
index d568c6d7c0c5aa282b0644bd1000e0de443f4ffe..cb76a5528ea30e6831e6fe0c8379e33d6d52329b 100644 (file)
@@ -45,6 +45,14 @@ wxDataInputStream::~wxDataInputStream()
 #endif // wxUSE_UNICODE
 }
 
+#if wxUSE_UNICODE
+void wxDataInputStream::SetConv( const wxMBConv &conv )
+{
+    delete m_conv;
+    m_conv = conv.Clone();
+}
+#endif
+
 #if wxHAS_INT64
 wxUint64 wxDataInputStream::Read64()
 {
@@ -106,11 +114,10 @@ wxString wxDataInputStream::ReadString()
     if ( len > 0 )
     {
 #if wxUSE_UNICODE
-        wxCharBuffer tmp(len + 1);
+        wxCharBuffer tmp(len);
         if ( tmp )
         {
             m_input->Read(tmp.data(), len);
-            tmp.data()[len] = '\0';
             ret = m_conv->cMB2WX(tmp.data());
         }
 #else
@@ -473,6 +480,14 @@ wxDataOutputStream::~wxDataOutputStream()
 #endif // wxUSE_UNICODE
 }
 
+#if wxUSE_UNICODE
+void wxDataOutputStream::SetConv( const wxMBConv &conv )
+{
+    delete m_conv;
+    m_conv = conv.Clone();
+}
+#endif
+
 #if wxHAS_INT64
 void wxDataOutputStream::Write64(wxUint64 i)
 {
@@ -533,8 +548,13 @@ void wxDataOutputStream::WriteDouble(double d)
 #if wxUSE_APPLE_IEEE
   wxConvertToIeeeExtended(d, (wxInt8 *)buf);
 #else
+  wxUnusedVar(d);
 #if !defined(__VMS__) && !defined(__GNUG__)
+#ifdef _MSC_VER
+# pragma message("wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!")
+#else
 # pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!"
+#endif
 #endif
    buf[0] = '\0';
 #endif