]> git.saurik.com Git - wxWidgets.git/commitdiff
Return false from PositionToXY if passed in position is larger than the buffer. This...
authorMart Raudsepp <leio@gentoo.org>
Fri, 14 Jul 2006 04:22:38 +0000 (04:22 +0000)
committerMart Raudsepp <leio@gentoo.org>
Fri, 14 Jul 2006 04:22:38 +0000 (04:22 +0000)
functionality of the boolean return value, while not returning false for valid input from end of buffer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40090 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/textctrl.cpp

index 1443e5777904aa768abd5e7c4a15dc004f7bf2a0..b9671b28503b39c6ff6b36340a35d66476145b8e 100644 (file)
@@ -943,6 +943,10 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
     if ( m_windowStyle & wxTE_MULTILINE )
     {
         GtkTextIter iter;
+
+        if (pos > GetLastPosition())
+            return false;
+
         gtk_text_buffer_get_iter_at_offset(m_buffer, &iter, pos);
 
         if ( y )