X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9863f4ea1ab957e59b421d36e6199c7b472476d..0b7dce5480b8cf7ce4368122744d853f7a684e34:/src/common/textentrycmn.cpp?ds=sidebyside diff --git a/src/common/textentrycmn.cpp b/src/common/textentrycmn.cpp index 5ec6850708..8e0551c3db 100644 --- a/src/common/textentrycmn.cpp +++ b/src/common/textentrycmn.cpp @@ -41,10 +41,10 @@ wxString wxTextEntryBase::GetRange(long from, long to) const { wxString sel; wxString value = GetValue(); - - if ((from < to) && ((long)value.length() >= to + from)) + + if ( from < to && (long)value.length() >= to ) { - sel = GetValue().substr(from, to - from); + sel = value.substr(from, to - from); } return sel; @@ -62,6 +62,8 @@ void wxTextEntryBase::DoSetValue(const wxString& value, int flags) SelectAll(); WriteText(value); + + SetInsertionPoint(0); } void wxTextEntryBase::Replace(long from, long to, const wxString& value)