]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
fixed a typo in IsExposed, put SetValidator in correct (in alpha order) place
[wxWidgets.git] / src / common / string.cpp
index 9f97667da3d72099ccdb084c6d7ab7e7b33bd2cf..25e4aa3de314525ee7714ff9d52e1e7b0a742dd2 100644 (file)
@@ -79,7 +79,7 @@ static const struct
 } g_strEmpty = { {-1, 0, 0}, wxT('\0') };
 
 // empty C style string: points to 'string data' byte of g_strEmpty
-extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
+extern const wxChar WXDLLIMPEXP_BASE *wxEmptyString = &g_strEmpty.dummy;
 
 // ----------------------------------------------------------------------------
 // global functions
@@ -958,8 +958,13 @@ wxString wxString::AfterFirst(wxChar ch) const
 }
 
 // replace first (or all) occurences of some substring with another one
-size_t wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplaceAll)
+size_t
+wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplaceAll)
 {
+    // if we tried to replace an empty string we'd enter an infinite loop below
+    wxCHECK_MSG( szOld && *szOld && szNew, 0,
+                 _T("wxString::Replace(): invalid parameter") );
+
   size_t uiCount = 0;   // count of replacements made
 
   size_t uiOldLen = wxStrlen(szOld);