]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
remove the vertical scrollbar completely if the control is empty
[wxWidgets.git] / src / common / string.cpp
index de7500d0b222f7ce0460f1826950355ab708a580..b4735f8d07a507380082438845c58f6eeebf772e 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        string.cpp
+// Name:        src/common/string.cpp
 // Purpose:     wxString class
 // Author:      Vadim Zeitlin, Ryan Norton
 // Modified by:
 #include "wx/wxprec.h"
 
 #ifdef __BORLANDC__
-  #pragma hdrstop
+    #pragma hdrstop
 #endif
 
 #ifndef WX_PRECOMP
-  #include "wx/defs.h"
-  #include "wx/string.h"
-  #include "wx/intl.h"
-  #include "wx/thread.h"
+    #include "wx/string.h"
+    #include "wx/intl.h"
+    #include "wx/thread.h"
 #endif
 
 #include <ctype.h>
@@ -40,7 +39,7 @@
 #include <stdlib.h>
 
 #ifdef __SALFORDC__
-  #include <clib.h>
+    #include <clib.h>
 #endif
 
 // allocating extra space for each string consumes more memory but speeds up
@@ -1013,13 +1012,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 +1041,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;