X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a9fa0d6b59c5c299766b3ed71ccadeeebf3dbb8..3ef37e7f4ec5f0688a4fb47e530ca2d30a6bb3ed:/src/mac/textctrl.cpp?ds=sidebyside diff --git a/src/mac/textctrl.cpp b/src/mac/textctrl.cpp index 97588b198b..a28eb9241c 100644 --- a/src/mac/textctrl.cpp +++ b/src/mac/textctrl.cpp @@ -748,7 +748,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, } wxString st = str ; - st.Replace(wxT("\n"), wxT("\r")); + wxMacConvertNewlines13To10( &st ) ; if ( !m_macUsesTXN ) { m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , "\p" , false , 0 , 0 , 1, @@ -865,7 +865,7 @@ wxString wxTextCtrl::GetValue() const } #endif } - result.Replace(wxT("\r"),wxT("\n")) ; + wxMacConvertNewlines10To13( &result ) ; return result ; } @@ -885,7 +885,7 @@ void wxTextCtrl::GetSelection(long* from, long* to) const void wxTextCtrl::SetValue(const wxString& str) { wxString st = str ; - st.Replace(wxT("\n"), wxT("\r")); + wxMacConvertNewlines13To10( &st ) ; if ( !m_macUsesTXN ) { wxCharBuffer text = st.mb_str(wxConvLocal) ; @@ -1174,7 +1174,7 @@ long wxTextCtrl::GetLastPosition() const void wxTextCtrl::Replace(long from, long to, const wxString& str) { wxString value = str ; - value.Replace(wxT("\n"), wxT("\r")); + wxMacConvertNewlines13To10( &value ) ; if ( !m_macUsesTXN ) { ControlEditTextSelectionRec selection ; @@ -1279,7 +1279,7 @@ bool wxTextCtrl::LoadFile(const wxString& file) void wxTextCtrl::WriteText(const wxString& str) { wxString st = str ; - st.Replace(wxT("\n"), wxT("\r")); + wxMacConvertNewlines13To10( &st ) ; if ( !m_macUsesTXN ) { wxCharBuffer text = st.mb_str(wxConvLocal) ;