]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Made gnome printing stuff return wxPRINT_CANCELLED if
[wxWidgets.git] / src / common / string.cpp
index 6b21ca1b09588be2a81743b63c5c93ffc86c5c07..b9e30160aa606bdb8ac09986cc96d61489c8b57e 100644 (file)
@@ -481,8 +481,14 @@ size_t wxStringBase::find(const wxStringBase& str, size_t nStart) const
   while(p - c_str() + str.length() <= length() &&
         wxTmemcmp(p, str.c_str(), str.length()) )
   {
+      //Previosly passed as the first argument to wxTmemchr,
+      //but C/C++ standard does not specify evaluation order
+      //of arguments to functions -
+      //http://embedded.com/showArticle.jhtml?articleID=9900607
+      ++p;
+
       //anchor again
-      p = (const wxChar*)wxTmemchr(++p,
+      p = (const wxChar*)wxTmemchr(p,
                                   str.c_str()[0],
                                   length() - (p - c_str()));
 
@@ -1024,7 +1030,7 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
         size_t nRealSize;
         wxWCharBuffer theBuffer = conv.cMB2WC(psz, nLen, &nRealSize);
 
-        //Copy 
+        //Copy
         if (nRealSize)
             assign( theBuffer.data() , nRealSize - 1 );
     }
@@ -1080,7 +1086,7 @@ wxString::wxString(const wchar_t *pwz, wxMBConv& conv, size_t nLength)
         size_t nRealSize;
         wxCharBuffer theBuffer = conv.cWC2MB(pwz, nLen, &nRealSize);
 
-        //Copy 
+        //Copy
         if (nRealSize)
             assign( theBuffer.data() , nRealSize - 1 );
     }
@@ -1629,7 +1635,7 @@ inline int wxSafeIsspace(wxChar ch) { return (ch < 127) && wxIsspace(ch); }
 wxString& wxString::Trim(bool bFromRight)
 {
   // first check if we're going to modify the string at all
-  if ( !IsEmpty() &&
+  if ( !empty() &&
        (
         (bFromRight && wxSafeIsspace(GetChar(Len() - 1))) ||
         (!bFromRight && wxSafeIsspace(GetChar(0u)))
@@ -2195,6 +2201,11 @@ wxString* wxArrayString::GetStringArray() const
     return array;
 }
 
+void wxArrayString::Remove(size_t nIndex, size_t nRemove)
+{
+    RemoveAt(nIndex, nRemove);
+}
+
 #endif // WXWIN_COMPATIBILITY_2_4
 
 // searches the array for an item (forward or backwards)