From 905f21104d7808e6cce29758f824e21520cb3ff7 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 11 Dec 2003 07:12:27 +0000 Subject: [PATCH] Applied patch [ 810585 ] wxTextCtrl::GetTextLine returns empty String git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 13 ++++++++++++- src/gtk1/textctrl.cpp | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 3d03f75d3b..d4d643282f 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -673,10 +673,21 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const return buf; } else -#endif { return wxEmptyString; } +#else + GtkTextBuffer *text_buffer; + text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(m_text)); + GtkTextIter line; + gtk_text_buffer_get_iter_at_line(text_buffer,&line,lineNo); + GtkTextIter end; + gtk_text_buffer_get_end_iter(text_buffer,&end ); + gchar *text = gtk_text_buffer_get_text(text_buffer,&line,&end,TRUE); + wxString result(text); + g_free(text); + return result.BeforeFirst(wxT('\n')); +#endif } else { diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 3d03f75d3b..d4d643282f 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -673,10 +673,21 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const return buf; } else -#endif { return wxEmptyString; } +#else + GtkTextBuffer *text_buffer; + text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(m_text)); + GtkTextIter line; + gtk_text_buffer_get_iter_at_line(text_buffer,&line,lineNo); + GtkTextIter end; + gtk_text_buffer_get_end_iter(text_buffer,&end ); + gchar *text = gtk_text_buffer_get_text(text_buffer,&line,&end,TRUE); + wxString result(text); + g_free(text); + return result.BeforeFirst(wxT('\n')); +#endif } else { -- 2.45.2