]> git.saurik.com Git - wxWidgets.git/commitdiff
attemps to make wxStreamToTextRedirector work with more (broken) compilers
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Sep 2003 22:17:38 +0000 (22:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Sep 2003 22:17:38 +0000 (22:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/textctrl.h

index 60107fca4fcfc5f3d4f049bb845d61ac579cb818..eb69adfdc449fab840a318174718b02abae8e861 100644 (file)
@@ -435,14 +435,26 @@ typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&);
 
 class WXDLLEXPORT wxStreamToTextRedirector
 {
-public:
-    wxStreamToTextRedirector(wxTextCtrl *text, wxSTD ostream *ostr = NULL)
-        : m_ostr(ostr ? *ostr : wxSTD cout)
+private:
+    void Init()
     {
         m_sbufOld = m_ostr.rdbuf();
         m_ostr.rdbuf(text);
     }
 
+public:
+    wxStreamToTextRedirector(wxTextCtrl *text)
+        : m_ostr(wxSTD cout)
+    {
+        Init();
+    }
+
+    wxStreamToTextRedirector(wxTextCtrl *text, wxSTD ostream *ostr)
+        : m_ostr(*ostr)
+    {
+        Init();
+    }
+
     ~wxStreamToTextRedirector()
     {
         m_ostr.rdbuf(m_sbufOld);