From 9806a823b04b05f1f07121526e5a9fafb74689cd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 19 Sep 2003 22:17:38 +0000 Subject: [PATCH] attemps to make wxStreamToTextRedirector work with more (broken) compilers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/textctrl.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 60107fca4f..eb69adfdc4 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -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); -- 2.50.0