]> git.saurik.com Git - wxWidgets.git/commitdiff
if the wxTextCtrl is empty set by SetInsertionPointEnd to 0 and not to -1.
authorMart Raudsepp <leio@gentoo.org>
Mon, 9 Nov 1998 08:09:03 +0000 (08:09 +0000)
committerMart Raudsepp <leio@gentoo.org>
Mon, 9 Nov 1998 08:09:03 +0000 (08:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/textctrl.cpp
src/gtk1/textctrl.cpp

index d7e77bbc56dfee85284411259025410585384801..7373c0ad2cf85c440300b569a76a0fdb60f98133 100644 (file)
@@ -414,7 +414,7 @@ void wxTextCtrl::SetInsertionPointEnd()
     pos = gtk_text_get_length( GTK_TEXT(m_text) );
   else
     pos = GTK_ENTRY(m_text)->text_length;
     pos = gtk_text_get_length( GTK_TEXT(m_text) );
   else
     pos = GTK_ENTRY(m_text)->text_length;
-  SetInsertionPoint( pos-1 );
+  SetInsertionPoint((pos-1)>0 ? (pos-1):0);
 }
 
 void wxTextCtrl::SetEditable( bool editable )
 }
 
 void wxTextCtrl::SetEditable( bool editable )
index d7e77bbc56dfee85284411259025410585384801..7373c0ad2cf85c440300b569a76a0fdb60f98133 100644 (file)
@@ -414,7 +414,7 @@ void wxTextCtrl::SetInsertionPointEnd()
     pos = gtk_text_get_length( GTK_TEXT(m_text) );
   else
     pos = GTK_ENTRY(m_text)->text_length;
     pos = gtk_text_get_length( GTK_TEXT(m_text) );
   else
     pos = GTK_ENTRY(m_text)->text_length;
-  SetInsertionPoint( pos-1 );
+  SetInsertionPoint((pos-1)>0 ? (pos-1):0);
 }
 
 void wxTextCtrl::SetEditable( bool editable )
 }
 
 void wxTextCtrl::SetEditable( bool editable )