X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3a9fa0d6b59c5c299766b3ed71ccadeeebf3dbb8..ba1e9d6cede4073faf42e3e290a030965a2205c3:/src/mac/textctrl.cpp diff --git a/src/mac/textctrl.cpp b/src/mac/textctrl.cpp index 97588b198b..ad911c3987 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) ; @@ -1316,10 +1316,6 @@ void wxTextCtrl::AppendText(const wxString& text) void wxTextCtrl::Clear() { - if ( !IsEditable() ) - { - return ; - } if ( !m_macUsesTXN ) { ::SetControlData((ControlHandle) m_macControl, 0, ( m_windowStyle & wxTE_PASSWORD ) ? kControlEditTextPasswordTag : kControlEditTextTextTag , 0 , (char*) ((const char*)NULL) ) ;