]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/utilscmn.cpp
Use text/uri-list instead of x-moz-url in wxGTK wxURLDataObject.
[wxWidgets.git] / src / common / utilscmn.cpp
index 749d1ff6cb8d4bb3f25f1bea0a2eafb3342349c9..147b3748b554ddd4f244642379b6a63b6624f19d 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
@@ -551,6 +551,11 @@ bool wxGetEnvMap(wxEnvVariableHashMap *map)
     wxCHECK_MSG( map, false, wxS("output pointer can't be NULL") );
 
 #if defined(__VISUALC__)
+    // This variable only exists to force the CRT to fill the wide char array,
+    // it might only have it in narrow char version until now as we use main()
+    // (and not _wmain()) as our entry point.
+    static wxChar* s_dummyEnvVar = _tgetenv(wxT("TEMP"));
+
     wxChar **env = _tenviron;
 #elif defined(__VMS)
    // Now this routine wil give false for OpenVMS
@@ -583,9 +588,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 +1003,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 +1069,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 +1189,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') )
@@ -1275,7 +1280,7 @@ wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt)
     // Hack for wxNotebook case: at least in wxGTK, all pages
     // claim to be shown, so we must only deal with the selected one.
 #if wxUSE_NOTEBOOK
-    if (win->IsKindOf(CLASSINFO(wxNotebook)))
+    if (wxDynamicCast(win, wxNotebook))
     {
       wxNotebook* nb = (wxNotebook*) win;
       int sel = nb->GetSelection();