From 2851cf2582acde2f8a7639073037e1c648ddcf2e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 19 Sep 2008 10:17:51 +0000 Subject: [PATCH] fix bug in SetInsertionPoint(-1) implementation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55732 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textentry.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index 4ea98d5bb0..9c5a0fc93e 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -243,6 +243,11 @@ bool wxTextEntry::CanRedo() const void wxTextEntry::SetInsertionPoint(long pos) { + // calling DoSetSelection(-1, -1) would select everything which is not what + // we want here + if ( pos == -1 ) + pos = GetLastPosition(); + // be careful to call DoSetSelection() which is overridden in wxTextCtrl // and not just SetSelection() here DoSetSelection(pos, pos);