From f17229426372a5b375937c4257de1bc5160d7a20 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:41:36 +0000 Subject: [PATCH] treat -1 as the last position in wxTextCtrl::SetInsertionPoint git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/textctrl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 0a68b34f12..f6184a0e03 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -1304,6 +1304,9 @@ void wxTextCtrl::AppendText(const wxString& text) void wxTextCtrl::SetInsertionPoint(wxTextPos pos) { + if ( pos == -1 ) + pos = GetLastPosition(); + wxCHECK_RET( pos >= 0 && pos <= GetLastPosition(), wxT("insertion point position out of range") );