Patch: small fix in Polygon & Text Component

Olga Rodimina rodimina@redhat.com
Mon Dec 8 17:40:00 GMT 2003


Hi,

This patch fixes small error in Polygon Component and also get rids of 
"uninitialized  variable" warnings generated in the Text Components.

Olga.












-------------- next part --------------
? .snprj
? libjava2.proj
? patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2426
diff -c -p -u -p -r1.2426 ChangeLog
--- ChangeLog	8 Dec 2003 12:45:58 -0000	1.2426
+++ ChangeLog	8 Dec 2003 17:30:52 -0000
@@ -1,3 +1,14 @@
+2003-12-08 Olga Rodimina <rodimina@redhat.com>
+	
+	* java/awt/Polygon.java
+	(translate): Fixed error that caused polygon 
+	to move right/left when up/down translation was required.
+	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:
+	(getSelectionStart): Initialized start position to 0. 
+	(getSelectionEnd): Initialized end position to 0.
+	(getCaretPosition): Initialized caret position to 0.
+	(getText): Initialized selected text to NULL 
+
 2003-12-08  Michael Koch  <konqueror@gmx.de>
 
 	Fix for PR libgcj/13176.
Index: java/awt/Polygon.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Polygon.java,v
retrieving revision 1.2
diff -c -p -u -p -r1.2 Polygon.java
--- java/awt/Polygon.java	9 Aug 2002 04:26:14 -0000	1.2
+++ java/awt/Polygon.java	8 Dec 2003 17:30:53 -0000
@@ -185,7 +185,7 @@ public class Polygon implements Shape, S
     while (--i >= 0)
       {
         xpoints[i] += dx;
-        xpoints[i] += dy;
+        ypoints[i] += dy;
       }
     if (bounds != null)
       {
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c,v
retrieving revision 1.8
diff -c -p -u -p -r1.8 gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c	1 Dec 2003 20:23:50 -0000	1.8
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c	8 Dec 2003 17:30:55 -0000
@@ -101,7 +101,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextCompon
   (JNIEnv *env, jobject obj)
 {
   void *ptr;
-  int pos;
+  int pos = 0;
   GtkEditable *editable;    // type of GtkEntry    (TextField)
   GtkWidget *text = NULL;   // type of GtkTextView (TextArea)
   GtkTextBuffer *buf;
@@ -187,7 +187,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextCompon
   (JNIEnv *env, jobject obj)
 {
   void *ptr;
-  int pos;
+  int pos = 0;
   GtkEditable *editable;    // type of GtkEntry    (TextField)
   GtkWidget *text = NULL;   // type of GtkTextView (TextArea)
   GtkTextBuffer *buf;
@@ -244,7 +244,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextCompon
   (JNIEnv *env, jobject obj)
 {
   void *ptr;
-  int pos;
+  int pos = 0;
   GtkEditable *editable;    // type of GtkEntry    (TextField)
   GtkWidget *text = NULL;   // type of GtkTextView (TextArea)
   GtkTextBuffer *buf;
@@ -384,7 +384,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextCompon
   (JNIEnv *env, jobject obj)
 {
   void *ptr;
-  char *contents;
+  char *contents = NULL;
   jstring jcontents;
   GtkEditable *editable;    // type of GtkEntry    (TextField)
   GtkWidget *text = NULL;   // type of GtkTextView (TextArea)


More information about the Java-patches mailing list