From 8c6785f0710776f4728e52f9804649820d02f568 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Thu, 14 Jul 2005 22:11:28 +0000 Subject: [PATCH] Optimize wxGTK2 wxTextCtrl::GetLineText git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/textctrl.cpp | 6 +++--- src/gtk1/textctrl.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index e852530107..3f975f9b1f 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1091,12 +1091,12 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const #else GtkTextIter line; gtk_text_buffer_get_iter_at_line(m_buffer,&line,lineNo); - GtkTextIter end; - gtk_text_buffer_get_end_iter(m_buffer,&end ); + GtkTextIter end = line; + gtk_text_iter_forward_to_line_end(&end); gchar *text = gtk_text_buffer_get_text(m_buffer,&line,&end,TRUE); wxString result(wxGTK_CONV_BACK(text)); g_free(text); - return result.BeforeFirst(wxT('\n')); + return result; #endif } else diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index e852530107..3f975f9b1f 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -1091,12 +1091,12 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const #else GtkTextIter line; gtk_text_buffer_get_iter_at_line(m_buffer,&line,lineNo); - GtkTextIter end; - gtk_text_buffer_get_end_iter(m_buffer,&end ); + GtkTextIter end = line; + gtk_text_iter_forward_to_line_end(&end); gchar *text = gtk_text_buffer_get_text(m_buffer,&line,&end,TRUE); wxString result(wxGTK_CONV_BACK(text)); g_free(text); - return result.BeforeFirst(wxT('\n')); + return result; #endif } else -- 2.45.2