]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/stringimpl.cpp
compilation fix after last commit
[wxWidgets.git] / src / common / stringimpl.cpp
index f16811fa7a41c97d977f135ca43245d55b99d502..e8750dc4f0e2c9b923169a0c4d9a826b2cdf8cf4 100644 (file)
@@ -170,17 +170,15 @@ void wxStringImpl::InitWith(const wxChar *psz, size_t nPos, size_t nLength)
   }
 }
 
-// poor man's iterators are "void *" pointers
-wxStringImpl::wxStringImpl(const void *pStart, const void *pEnd)
+wxStringImpl::wxStringImpl(const_iterator first, const_iterator last)
 {
-  if ( pEnd >= pStart )
+  if ( last >= first )
   {
-    InitWith((const wxChar *)pStart, 0,
-             (const wxChar *)pEnd - (const wxChar *)pStart);
+    InitWith(first, 0, last - first);
   }
   else
   {
-    wxFAIL_MSG( _T("pStart is not before pEnd") );
+    wxFAIL_MSG( _T("first must be before last") );
     Init();
   }
 }
@@ -300,6 +298,7 @@ wxStringImpl& wxStringImpl::append(size_t n, wxStringCharType ch)
 
     if ( !Alloc(len + n) || !CopyBeforeWrite() ) {
       wxFAIL_MSG( _T("out of memory in wxStringImpl::append") );
+      return *this;
     }
     GetStringData()->nDataLength = len + n;
     m_pchData[len + n] = '\0';
@@ -421,6 +420,7 @@ wxStringImpl& wxStringImpl::insert(size_t nPos, const wxChar *sz, size_t n)
 
     if ( !Alloc(length() + n) || !CopyBeforeWrite() ) {
         wxFAIL_MSG( _T("out of memory in wxStringImpl::insert") );
+        return *this;
     }
 
     memmove(m_pchData + nPos + n, m_pchData + nPos,