X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ccc20afae9a2ed83677e6f46a8472d3b39a087c4..69659fd770f615210efac4b4fa741b3ad6223616:/src/univ/textctrl.cpp diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index afba680e8d..487fb2fca0 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -1444,8 +1444,12 @@ wxString wxTextCtrl::GetSelectionText() const void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to) { // selecting till -1 is the same as selecting to the end - if ( to == -1 && from != -1 ) + if ( to == -1 ) { + // and selecting (-1, -1) range is the same as selecting everything, by + // convention + if ( from == -1 ) + from = 0; to = GetLastPosition(); }