]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 810585 ] wxTextCtrl::GetTextLine returns empty String
authorJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 07:12:27 +0000 (07:12 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 11 Dec 2003 07:12:27 +0000 (07:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index 3d03f75d3b75a296255c96d4ed1f19c2aed25e7d..d4d643282f4397f33edb127ab42fc72912c85b3b 100644 (file)
@@ -673,10 +673,21 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const
             return buf;
         }
         else
             return buf;
         }
         else
-#endif
         {
             return wxEmptyString;
         }
         {
             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
     {
     }
     else
     {
index 3d03f75d3b75a296255c96d4ed1f19c2aed25e7d..d4d643282f4397f33edb127ab42fc72912c85b3b 100644 (file)
@@ -673,10 +673,21 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const
             return buf;
         }
         else
             return buf;
         }
         else
-#endif
         {
             return wxEmptyString;
         }
         {
             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
     {
     }
     else
     {