]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Only do this Show on wxGTK as it is needed there but can cause display
[wxWidgets.git] / src / common / string.cpp
index eb2d9d442d3147a0cc61cd364133607daa4a62f1..0eae6299c973bd7dae141f2e55919ca3363a942e 100644 (file)
@@ -1,11 +1,12 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        string.cpp
 // Purpose:     wxString class
-// Author:      Vadim Zeitlin
+// Author:      Vadim Zeitlin, Ryan Norton
 // Modified by:
 // Created:     29/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
+//              (c) 2004 Ryan Norton <wxprojects@comcast.net>
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -1118,7 +1119,7 @@ wxString::wxString(const wchar_t *pwz, wxMBConv& conv, size_t nLength)
 
             //Do the actual conversion & Set the length of the buffer
             internalBuffer.SetLength(
-                   conv.WC2MB(*this, pwz, dwConvLen + 1, nLen)
+                   conv.WC2MB(internalBuffer, pwz, dwConvLen + 1, nLen)
                                     );
         }
     }
@@ -1322,7 +1323,7 @@ static inline int wxDoCmpNoCase(const wxChar* s1, size_t l1,
             if(wxTolower(s1[i]) != wxTolower(s2[i]))
                 break;
         }
-        return i == l1 ? 0 : s1[i] < s2[i] ? -1 : 1;
+        return i == l1 ? 0 : wxTolower(s1[i]) < wxTolower(s2[i]) ? -1 : 1;
     }
     else if( l1 < l2 )
     {
@@ -1331,7 +1332,7 @@ static inline int wxDoCmpNoCase(const wxChar* s1, size_t l1,
             if(wxTolower(s1[i]) != wxTolower(s2[i]))
                 break;
         }
-        return i == l1 ? -1 : s1[i] < s2[i] ? -1 : 1;
+        return i == l1 ? -1 : wxTolower(s1[i]) < wxTolower(s2[i]) ? -1 : 1;
     }
     else if( l1 > l2 )
     {
@@ -1340,7 +1341,7 @@ static inline int wxDoCmpNoCase(const wxChar* s1, size_t l1,
             if(wxTolower(s1[i]) != wxTolower(s2[i]))
                 break;
         }
-        return i == l2 ? 1 : s1[i] < s2[i] ? -1 : 1;
+        return i == l2 ? 1 : wxTolower(s1[i]) < wxTolower(s2[i]) ? -1 : 1;
     }
 
     wxFAIL;   // must never get there
@@ -1407,12 +1408,13 @@ const wxCharBuffer wxString::ToAscii() const
     // this will allocate enough space for the terminating NUL too
     wxCharBuffer buffer(length());
 
-    signed char *dest = (signed char *)buffer.data();
+
+    char *dest = buffer.data();
 
     const wchar_t *pwc = c_str();
     for ( ;; )
     {
-        *dest++ = *pwc > SCHAR_MAX ? wxT('_') : *pwc;
+        *dest++ = (char)(*pwc > SCHAR_MAX ? wxT('_') : *pwc);
 
         // the output string can't have embedded NULs anyhow, so we can safely
         // stop at first of them even if we do have any