]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/ustring.h
Don't send SELECTED events for an already selected item in wxGTK wxListBox.
[wxWidgets.git] / include / wx / ustring.h
index a59d46b307ea0f137fb49faefdb37f3072e4d3a1..0c00b6f9df3ccb779c7fbde9e1b2223c9167ed89 100644 (file)
@@ -35,6 +35,7 @@ typedef wxScopedCharTypeBuffer<wxChar32> wxScopedU32CharBuffer;
     // "non dll-interface class 'std::basic_string<wxChar32>' used as base
     // interface for dll-interface class 'wxString'" -- this is OK in our case
     // (and warning is unavoidable anyhow)
+    #pragma warning(push)
     #pragma warning(disable:4275)
 #endif
 
@@ -199,17 +200,43 @@ public:
         return (wxUString &) base->assign( str, pos, n );
     }
 
-    wxUString &assign( wxChar32 ch )
-    {
-        std::basic_string<wxChar32> *base = this;
-        return (wxUString &) base->assign( (size_type) 1, ch );
-    }
+    // FIXME-VC6:  VC 6.0 stl does not support all types of assign functions
+    #ifdef __VISUALC6__
+        wxUString &assign( wxChar32 ch )
+        {
+            wxChar32 chh[1];
+            chh[0] = ch;
+            std::basic_string<wxChar32> *base = this;
+            return (wxUString &)base->assign(chh);
+        }
 
-    wxUString &assign( size_type n, wxChar32 ch )
-    {
-        std::basic_string<wxChar32> *base = this;
-        return (wxUString &) base->assign( n, ch );
-    }
+        wxUString &assign( size_type n, wxChar32 ch )
+        {
+            wxU32CharBuffer buffer(n);
+            wxChar32 *p = buffer.data();
+            size_type i;
+            for (i = 0; i < n; i++)
+            {
+               *p = ch;
+               p++;
+            }
+
+            std::basic_string<wxChar32> *base = this;
+            return (wxUString &)base->assign(buffer.data());
+        }
+    #else
+        wxUString &assign( wxChar32 ch )
+        {
+            std::basic_string<wxChar32> *base = this;
+            return (wxUString &) base->assign( (size_type) 1, ch );
+        }
+
+        wxUString &assign( size_type n, wxChar32 ch )
+        {
+            std::basic_string<wxChar32> *base = this;
+            return (wxUString &) base->assign( n, ch );
+        }
+    #endif // __VISUALC6__
 
     wxUString &assign( const wxScopedU32CharBuffer &buf )
     {
@@ -356,11 +383,29 @@ public:
         return (wxUString &) base->append( s, n );
     }
 
-    wxUString &append( size_type n, wxChar32 c )
-    {
-        std::basic_string<wxChar32> *base = this;
-        return (wxUString &) base->append( n, c );
-    }
+    // FIXME-VC6:  VC 6.0 stl does not support all types of append functions
+    #ifdef __VISUALC6__
+        wxUString &append( size_type n, wxChar32 c )
+        {
+            wxU32CharBuffer buffer(n);
+            wxChar32 *p = buffer.data();
+            size_type i;
+            for (i = 0; i < n; i++)
+            {
+               *p = c;
+               p++;
+            }
+
+            std::basic_string<wxChar32> *base = this;
+            return (wxUString &) base->append(buffer.data());
+        }
+    #else
+        wxUString &append( size_type n, wxChar32 c )
+        {
+            std::basic_string<wxChar32> *base = this;
+            return (wxUString &) base->append( n, c );
+        }
+    #endif // __VISUALC6__
 
     wxUString &append( wxChar32 c )
     {
@@ -596,7 +641,7 @@ public:
 };
 
 #ifdef __VISUALC__
-    #pragma warning(default:4275)
+    #pragma warning(pop)
 #endif
 
 inline wxUString operator+(const wxUString &s1, const wxUString &s2)