From 01207937f66da7698eecfd3c61b8204914fec7f6 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Fri, 14 Jul 2006 04:22:38 +0000 Subject: [PATCH] Return false from PositionToXY if passed in position is larger than the buffer. This should restore the 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 1443e57779..b9671b2850 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -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 ) -- 2.50.0