]> git.saurik.com Git - wxWidgets.git/commitdiff
Optimize wxGTK2 wxTextCtrl::GetLineText
authorMart Raudsepp <leio@gentoo.org>
Thu, 14 Jul 2005 22:11:28 +0000 (22:11 +0000)
committerMart Raudsepp <leio@gentoo.org>
Thu, 14 Jul 2005 22:11:28 +0000 (22:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index e8525301078558339a6bbefaf2106f0f1511afb3..3f975f9b1ff4636a8cbb27f0124772ed82114451 100644 (file)
@@ -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
index e8525301078558339a6bbefaf2106f0f1511afb3..3f975f9b1ff4636a8cbb27f0124772ed82114451 100644 (file)
@@ -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