]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/buffer.h
don't define, nor use, LVS_EX_LABELTIP under WinCE
[wxWidgets.git] / include / wx / buffer.h
index a18b85c7626ebe4c39b3deab96db8d6e7ffd8b30..d06fbf6fc15b57a76d726521cd9f4295621bd111 100644 (file)
@@ -105,9 +105,12 @@ public:
 
     wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src)
     {
 
     wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src)
     {
-        if ( m_owned )
-            free(m_str);
-        CopyFrom(src);
+        if (&src != this)
+        {
+            if ( m_owned )
+                free(m_str);
+            CopyFrom(src);
+        }
         return *this;
     }
 
         return *this;
     }
 
@@ -226,6 +229,13 @@ typedef wxWritableCharTypeBuffer<wchar_t> wxWritableWCharBuffer;
     #define wxWX2WCbuf wxWCharBuffer
 #endif // Unicode/ANSI
 
     #define wxWX2WCbuf wxWCharBuffer
 #endif // Unicode/ANSI
 
+// type of the value returned by wxString::utf8_str()
+#if wxUSE_UNICODE_UTF8
+    #define wxUTF8Buf char *
+#else
+    #define wxUTF8Buf wxCharBuffer
+#endif
+
 // ----------------------------------------------------------------------------
 // A class for holding growable data buffers (not necessarily strings)
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // A class for holding growable data buffers (not necessarily strings)
 // ----------------------------------------------------------------------------
@@ -310,9 +320,12 @@ public:
 
     wxMemoryBuffer& operator=(const wxMemoryBuffer& src)
     {
 
     wxMemoryBuffer& operator=(const wxMemoryBuffer& src)
     {
-        m_bufdata->DecRef();
-        m_bufdata = src.m_bufdata;
-        m_bufdata->IncRef();
+        if (&src != this)
+        {
+            m_bufdata->DecRef();
+            m_bufdata = src.m_bufdata;
+            m_bufdata->IncRef();
+        }
         return *this;
     }
 
         return *this;
     }