]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/strconv.cpp
added find performance test (see #9870) and the possibility to set the number of...
[wxWidgets.git] / src / common / strconv.cpp
index 64d31ae75075b8e76301ebc5731d2c8fa9bc269c..dd1844c5b2c2a38e039ca1002a6c365f7bbbd010 100644 (file)
@@ -333,7 +333,7 @@ wxMBConv::FromWChar(char *dst, size_t dstLen,
             return wxCONV_FAILED;
 
         dstWritten += lenChunk;
             return wxCONV_FAILED;
 
         dstWritten += lenChunk;
-        if ( isNulTerminated )
+        if ( src+lenChunk < srcEnd || isNulTerminated )
             dstWritten += lenNul;
 
         if ( dst )
             dstWritten += lenNul;
 
         if ( dst )
@@ -345,7 +345,7 @@ wxMBConv::FromWChar(char *dst, size_t dstLen,
                 return wxCONV_FAILED;
 
             dst += lenChunk;
                 return wxCONV_FAILED;
 
             dst += lenChunk;
-            if ( isNulTerminated )
+            if ( src+lenChunk < srcEnd || isNulTerminated )
                 dst += lenNul;
         }
     }
                 dst += lenNul;
         }
     }
@@ -2849,7 +2849,7 @@ private:
     // were we initialized successfully?
     bool m_ok;
 
     // were we initialized successfully?
     bool m_ok;
 
-    DECLARE_NO_COPY_CLASS(wxMBConv_wxwin)
+    wxDECLARE_NO_COPY_CLASS(wxMBConv_wxwin);
 };
 
 // make the constructors available for unit testing
 };
 
 // make the constructors available for unit testing
@@ -3371,6 +3371,8 @@ wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws)
 
 #ifdef __WINDOWS__
     WX_DEFINE_GLOBAL_CONV2(wxMBConv, wxMBConv_win32, wxConvLibc, wxEMPTY_PARAMETER_VALUE);
 
 #ifdef __WINDOWS__
     WX_DEFINE_GLOBAL_CONV2(wxMBConv, wxMBConv_win32, wxConvLibc, wxEMPTY_PARAMETER_VALUE);
+#elif 0 // defined(__WXOSX__)
+    WX_DEFINE_GLOBAL_CONV2(wxMBConv, wxMBConv_cf, wxConvLibc,  (wxFONTENCODING_UTF8));
 #else
     WX_DEFINE_GLOBAL_CONV2(wxMBConv, wxMBConvLibc, wxConvLibc, wxEMPTY_PARAMETER_VALUE);
 #endif
 #else
     WX_DEFINE_GLOBAL_CONV2(wxMBConv, wxMBConvLibc, wxConvLibc, wxEMPTY_PARAMETER_VALUE);
 #endif