]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/utilscmn.cpp
A patch adding wxHTMLDataObject which can be used for handling the standard platform...
[wxWidgets.git] / src / common / utilscmn.cpp
index 749d1ff6cb8d4bb3f25f1bea0a2eafb3342349c9..d9ce6b56ff9589990ef07e5a04351b9974ff2398 100644 (file)
     #include "wx/osx/private.h"
 #endif
 
-#if !defined(__MWERKS__) && !defined(__WXWINCE__)
+#if !defined(__WXWINCE__)
     #include <sys/types.h>
     #include <sys/stat.h>
 #endif
 
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
     #include "wx/msw/private.h"
     #include "wx/filesys.h"
 #endif
@@ -350,7 +350,7 @@ void wxPlatform::ClearPlatforms()
 
 bool wxPlatform::Is(int platform)
 {
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
     if (platform == wxOS_WINDOWS)
         return true;
 #endif
@@ -583,9 +583,9 @@ bool wxGetEnvMap(wxEnvVariableHashMap *map)
     // standard headers anyhow so we can just rely on already having the
     // correct declaration. And if this turns out to be wrong, we can always
     // add a configure test checking whether it is declared later.
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
     extern char **environ;
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
 
     char **env = environ;
 #endif
@@ -998,7 +998,7 @@ bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
 // Launch default browser
 // ----------------------------------------------------------------------------
 
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
 
 // implemented in a port-specific utils source file:
 bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int flags);
@@ -1064,7 +1064,7 @@ static bool DoLaunchDefaultBrowserHelper(const wxString& urlOrig, int flags)
     // (e.g. "C:\\test.txt" when parsed by wxURI reports a scheme == "C")
     bool hasValidScheme = uri.HasScheme() && uri.GetScheme().length() > 1;
 
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
 
     // NOTE: when testing wxMSW's wxLaunchDefaultBrowser all possible forms
     //       of the URL/flags should be tested; e.g.:
@@ -1184,22 +1184,22 @@ wxString wxStripMenuCodes(const wxString& in, int flags)
     size_t len = in.length();
     out.reserve(len);
 
-    for ( size_t n = 0; n < len; n++ )
+    for ( wxString::const_iterator it = in.begin(); it != in.end(); ++it )
     {
-        wxChar ch = in[n];
+        wxChar ch = *it;
         if ( (flags & wxStrip_Mnemonics) && ch == wxT('&') )
         {
             // skip it, it is used to introduce the accel char (or to quote
             // itself in which case it should still be skipped): note that it
             // can't be the last character of the string
-            if ( ++n == len )
+            if ( ++it == in.end() )
             {
                 wxLogDebug(wxT("Invalid menu string '%s'"), in.c_str());
             }
             else
             {
                 // use the next char instead
-                ch = in[n];
+                ch = *it;
             }
         }
         else if ( (flags & wxStrip_Accel) && ch == wxT('\t') )