]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
delete now does remove the item in correct synch from m_datas and m_strings
[wxWidgets.git] / src / common / string.cpp
index 4fd4c02a1466e3212058085f0abdb56f925786f1..a53c4378f9a6f3d2fd100dfab3019d18e61d01cd 100644 (file)
@@ -153,7 +153,7 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
 //
 // ATTN: you can _not_ use both of these in the same program!
 
 //
 // ATTN: you can _not_ use both of these in the same program!
 
-istream& operator>>(istream& is, wxString& WXUNUSED(str))
+wxSTD istream& operator>>(wxSTD istream& is, wxString& WXUNUSED(str))
 {
 #if 0
   int w = is.width(0);
 {
 #if 0
   int w = is.width(0);
@@ -184,7 +184,7 @@ istream& operator>>(istream& is, wxString& WXUNUSED(str))
   return is;
 }
 
   return is;
 }
 
-ostream& operator<<(ostream& os, const wxString& str)
+wxSTD ostream& operator<<(wxSTD ostream& os, const wxString& str)
 {
   os << str.c_str();
   return os;
 {
   os << str.c_str();
   return os;
@@ -201,7 +201,8 @@ extern int WXDLLEXPORT wxVsnprintf(wxChar *buf, size_t len,
     int iLen = s.PrintfV(format, argptr);
     if ( iLen != -1 )
     {
     int iLen = s.PrintfV(format, argptr);
     if ( iLen != -1 )
     {
-        wxStrncpy(buf, s.c_str(), iLen);
+        wxStrncpy(buf, s.c_str(), len);
+        buf[len-1] = wxT('\0');
     }
 
     return iLen;
     }
 
     return iLen;
@@ -1151,7 +1152,7 @@ wxString wxString::Format(const wxChar *pszFormat, ...)
 wxString wxString::FormatV(const wxChar *pszFormat, va_list argptr)
 {
     wxString s;
 wxString wxString::FormatV(const wxChar *pszFormat, va_list argptr)
 {
     wxString s;
-    s.Printf(pszFormat, argptr);
+    s.PrintfV(pszFormat, argptr);
     return s;
 }
 
     return s;
 }
 
@@ -1878,13 +1879,6 @@ void wxArrayString::Grow()
     else {
       // otherwise when it's called for the first time, nIncrement would be 0
       // and the array would never be expanded
     else {
       // otherwise when it's called for the first time, nIncrement would be 0
       // and the array would never be expanded
-#if defined(__VISAGECPP__) && defined(__WXDEBUG__)
-      int array_size = ARRAY_DEFAULT_INITIAL_SIZE;
-      wxASSERT( array_size != 0 );
-#else
-      wxASSERT( ARRAY_DEFAULT_INITIAL_SIZE != 0 );
-#endif
-
       // add 50% but not too much
       size_t nIncrement = m_nSize < ARRAY_DEFAULT_INITIAL_SIZE
                           ? ARRAY_DEFAULT_INITIAL_SIZE : m_nSize >> 1;
       // add 50% but not too much
       size_t nIncrement = m_nSize < ARRAY_DEFAULT_INITIAL_SIZE
                           ? ARRAY_DEFAULT_INITIAL_SIZE : m_nSize >> 1;