]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
install wxUniv headers in make install and include wxUniv sources in make dist
[wxWidgets.git] / src / common / string.cpp
index d0297f3c9718c3a4d455a46407d75ddd79394e7d..134cd452c656474af06995071b94fd4a9c151b7b 100644 (file)
@@ -340,10 +340,17 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
 
 #if wxUSE_WCHAR_T
 // from wide string
-wxString::wxString(const wchar_t *pwz, wxMBConv& conv)
+wxString::wxString(const wchar_t *pwz, wxMBConv& conv, size_t nLength)
 {
   // first get necessary size
-  size_t nLen = pwz ? conv.WC2MB((char *) NULL, pwz, 0) : 0;
+  size_t nLen = 0;
+  if (pwz)
+  {
+    if (nLength == wxSTRING_MAXLEN)
+      nLen = conv.WC2MB((char *) NULL, pwz, 0);
+    else
+      nLen = nLength;
+  }
 
   // empty?
   if ( (nLen != 0) && (nLen != (size_t)-1) ) {