]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
New wxEventType for event type enum, and corresponding alterations.
[wxWidgets.git] / src / common / string.cpp
index 6247bb0fabcb3815045e5c545787011f779de2aa..2b95e23f128551afd99a87ba9d824463de4cd607 100644 (file)
@@ -153,7 +153,7 @@ wxString::wxString(char ch, size_t nLength)
 
   if ( nLength > 0 ) {
     AllocBuffer(nLength);
-    
+
     wxASSERT( sizeof(char) == 1 );  // can't use memset if not
 
     memset(m_pchData, ch, nLength);
@@ -282,14 +282,14 @@ void wxString::AllocBeforeWrite(size_t nLen)
   wxASSERT( nLen != 0 );  // doesn't make any sense
 
   // must not share string and must have enough space
-  register wxStringData* pData = GetStringData();  
+  register wxStringData* pData = GetStringData();
   if ( pData->IsShared() || (nLen > pData->nAllocLength) ) {
     // can't work with old buffer, get new one
     pData->Unlock();
     AllocBuffer(nLen);
   }
 
-  wxASSERT( !pData->IsShared() );  // we must be the only owner
+  wxASSERT( !GetStringData()->IsShared() );  // we must be the only owner
 }
 
 // get the pointer to writable buffer of (at least) nLen bytes
@@ -862,6 +862,7 @@ int wxString::PrintfV(const char* pszFormat, va_list argptr)
   return iLen;
 }
 
+#if 0
 int wxString::Scanf(const char *pszFormat, ...) const
 {
   va_list argptr;
@@ -883,6 +884,7 @@ int wxString::ScanfV(const char *pszFormat, va_list argptr) const
   return vsscanf(c_str(), pszFormat, argptr);
 #endif
 }
+#endif
 
 // ---------------------------------------------------------------------------
 // standard C++ library string functions
@@ -894,7 +896,7 @@ wxString& wxString::insert(size_t nPos, const wxString& str)
   wxASSERT( nPos <= Len() );
 
   wxString strTmp;
-  char *pc = strTmp.GetWriteBuf(Len() + str.Len() + 1);
+  char *pc = strTmp.GetWriteBuf(Len() + str.Len());
   strncpy(pc, c_str(), nPos);
   strcpy(pc + nPos, str);
   strcpy(pc + nPos + str.Len(), c_str() + nPos);