changeset 993:98d73c9e81fc

Remove carriage return stripping for GTK2... it is only needed in GTK1.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 07 May 2011 19:44:51 +0000
parents 2d80b4dcff9a
children f1c7b03f944d
files gtk/dw.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Sat May 07 19:39:45 2011 +0000
+++ b/gtk/dw.c	Sat May 07 19:44:51 2011 +0000
@@ -4674,6 +4674,7 @@
     return 0L;
 }
 
+#if GTK_MAJOR_VERSION < 2
 void _strip_cr(char *dest, char *src)
 {
    int z, x = 0;
@@ -4688,6 +4689,7 @@
    }
    dest[x] = 0;
 }
+#endif
 
 /*
  * Adds text to an MLE box and returns the current point.
@@ -4713,18 +4715,14 @@
 #if GTK_MAJOR_VERSION > 1
       if(tmp && GTK_IS_TEXT_VIEW(tmp))
       {
-         char *impbuf = malloc(strlen(buffer)+1);
          GtkTextBuffer *tbuffer;
          GtkTextIter iter;
 
-         _strip_cr(impbuf, buffer);
-
          tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp));
          gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, startpoint);
          gtk_text_buffer_place_cursor(tbuffer, &iter);
-         gtk_text_buffer_insert_at_cursor(tbuffer, impbuf, -1);
-         tmppoint = (startpoint > -1 ? startpoint : 0) + strlen(impbuf);
-         free(impbuf);
+         gtk_text_buffer_insert_at_cursor(tbuffer, buffer, -1);
+         tmppoint = (startpoint > -1 ? startpoint : 0) + strlen(buffer);
       }
 #else
       GdkFont *font = (GdkFont *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_gdkfont");