From 665bb656986dcc9ec9017dcfc2ea5ecce2f38d39 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 15 Oct 2002 15:01:09 +0000 Subject: [PATCH] line ending commands under condition of PC endings (added also to WriteText) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/textctrl.cpp | 12 ++++++++++-- src/mac/textctrl.cpp | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index e82348226f..f7c30fc2ca 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -785,11 +785,13 @@ wxString wxTextCtrl::GetValue() const wxString value; if( wxApp::s_macDefaultEncodingIsPC ) + { value = wxMacMakePCStringFromMac( wxBuffer ) ; + value.Replace( "\r", "\n" ); + } else value = wxBuffer; - value.Replace( "\r", "\n" ); return value; } @@ -812,11 +814,13 @@ void wxTextCtrl::SetValue(const wxString& st) wxString value; if( wxApp::s_macDefaultEncodingIsPC ) + { value = wxMacMakeMacStringFromPC( st ) ; + value.Replace( "\n", "\r" ); + } else value = st; - value.Replace( "\n", "\r" ); if ( !m_macUsesTXN ) { @@ -1178,9 +1182,13 @@ void wxTextCtrl::WriteText(const wxString& text) { wxString value ; if( wxApp::s_macDefaultEncodingIsPC ) + { value = wxMacMakeMacStringFromPC( text ) ; + value.Replace( "\n", "\r" ); + } else value = text ; + if ( !m_macUsesTXN ) { TEInsert( value , value.Length() , ((TEHandle) m_macTE) ) ; diff --git a/src/mac/textctrl.cpp b/src/mac/textctrl.cpp index e82348226f..f7c30fc2ca 100644 --- a/src/mac/textctrl.cpp +++ b/src/mac/textctrl.cpp @@ -785,11 +785,13 @@ wxString wxTextCtrl::GetValue() const wxString value; if( wxApp::s_macDefaultEncodingIsPC ) + { value = wxMacMakePCStringFromMac( wxBuffer ) ; + value.Replace( "\r", "\n" ); + } else value = wxBuffer; - value.Replace( "\r", "\n" ); return value; } @@ -812,11 +814,13 @@ void wxTextCtrl::SetValue(const wxString& st) wxString value; if( wxApp::s_macDefaultEncodingIsPC ) + { value = wxMacMakeMacStringFromPC( st ) ; + value.Replace( "\n", "\r" ); + } else value = st; - value.Replace( "\n", "\r" ); if ( !m_macUsesTXN ) { @@ -1178,9 +1182,13 @@ void wxTextCtrl::WriteText(const wxString& text) { wxString value ; if( wxApp::s_macDefaultEncodingIsPC ) + { value = wxMacMakeMacStringFromPC( text ) ; + value.Replace( "\n", "\r" ); + } else value = text ; + if ( !m_macUsesTXN ) { TEInsert( value , value.Length() , ((TEHandle) m_macTE) ) ;