X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f81c1056ab15d9b165b80099affac947bd97c73e..3ef37e7f4ec5f0688a4fb47e530ca2d30a6bb3ed:/src/mac/textctrl.cpp?ds=sidebyside diff --git a/src/mac/textctrl.cpp b/src/mac/textctrl.cpp index 8e397f8618..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) ; @@ -1433,7 +1433,12 @@ bool wxTextCtrl::CanRedo() const return FALSE ; } -// Makes 'unmodified' +// Makes modifie or unmodified +void wxTextCtrl::MarkDirty() +{ + m_dirty = true; +} + void wxTextCtrl::DiscardEdits() { m_dirty = false;