]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/textcmn.cpp
fix for assert when setting tooltip for a readonly combo
[wxWidgets.git] / src / common / textcmn.cpp
index d1c0434cc2295d67ad7f222d2de2ca19ae259af7..0ce243a14111ba80826975086fc1bbf54a766d50 100644 (file)
 // ----------------------------------------------------------------------------
 
 wxTextCtrlBase::wxTextCtrlBase()
-#if !wxUSE_IOSTREAMH
-    #ifndef NO_TEXT_WINDOW_STREAM
-        :streambuf()
-    #endif //NO_TEXT_WINDOW_STREAM
-#endif //!wxUSE_IOSTREAMH
 {
-#if wxUSE_IOSTREAMH
-    #ifndef NO_TEXT_WINDOW_STREAM
-        if (allocate())
-            setp(base(),ebuf());
-    #endif // NO_TEXT_WINDOW_STREAM
-#endif //wxUSE_IOSTREAMH
+#ifndef NO_TEXT_WINDOW_STREAM
+  #if wxUSE_IOSTREAMH
+  if (allocate())
+    setp(base(),ebuf());
+  #else
+  m_streambuf=new char[64];
+  setp(m_streambuf,m_streambuf+64);
+  #endif //wxUSE_IOSTREAMH
+#endif // NO_TEXT_WINDOW_STREAM
+}
+
+wxTextCtrlBase::~wxTextCtrlBase()
+{
+#ifndef NO_TEXT_WINDOW_STREAM
+#if !wxUSE_IOSTREAMH
+  delete m_streambuf;
+#endif
+#endif
 }
 
 // ----------------------------------------------------------------------------