]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
centralized the handling of border styles; added borders support for wxListBox and...
[wxWidgets.git] / src / common / string.cpp
index de7500d0b222f7ce0460f1826950355ab708a580..aa039f976be436ac4687830a5f0032679d8f44ed 100644 (file)
@@ -1013,13 +1013,7 @@ wxString::wxString(const char *psz, const wxMBConv& conv, size_t nLength)
     {
         if ( nLength == npos )
         {
-            nLength = (size_t)-1;
-        }
-        else if ( nLength == length() )
-        {
-            // this is important to avoid copying the string in cMB2WC: we're
-            // already NUL-terminated so we can pass this NUL with the data
-            nLength++;
+            nLength = wxNO_LEN;
         }
 
         size_t nLenWide;
@@ -1048,13 +1042,7 @@ wxString::wxString(const wchar_t *pwz, const wxMBConv& conv, size_t nLength)
     {
         if ( nLength == npos )
         {
-            nLength = (size_t)-1;
-        }
-        else if ( nLength == length() )
-        {
-            // this is important to avoid copying the string in cMB2WC: we're
-            // already NUL-terminated so we can pass this NUL with the data
-            nLength++;
+            nLength = wxNO_LEN;
         }
 
         size_t nLenMB;