]> git.saurik.com Git - wxWidgets.git/commitdiff
fix bug in SetInsertionPoint(-1) implementation
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Sep 2008 10:17:51 +0000 (10:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Sep 2008 10:17:51 +0000 (10:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55732 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/textentry.cpp

index 4ea98d5bb0dc450453fd37884705350f1b2c9cfa..9c5a0fc93e49dccfe45a6464b4bc50b03ab67507 100644 (file)
@@ -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);