[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: Noa's Choice fixes

Kaffe CVS cvs-commits at kaffe.org
Wed Oct 27 12:12:42 PDT 2004


PatchSet 5372 
Date: 2004/10/27 19:08:23
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: Noa's Choice fixes

2004-10-27  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/awt/Choice.java:
        Resynced with GNU Classpath.

        2004-10-25  Noa Resare  <noa at resare.com>

        * java/awt/Choice.java (add):
        Implement correct selection behavior when peer == null.
        (insert): Likewise.
        (remove): Likewise.

Members: 
	ChangeLog:1.2924->1.2925 
	libraries/javalib/java/awt/Choice.java:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2924 kaffe/ChangeLog:1.2925
--- kaffe/ChangeLog:1.2924	Wed Oct 27 18:56:20 2004
+++ kaffe/ChangeLog	Wed Oct 27 19:08:23 2004
@@ -1,5 +1,17 @@
 2004-10-27  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/awt/Choice.java:
+        Resynced with GNU Classpath.
+
+	2004-10-25  Noa Resare  <noa at resare.com>
+
+        * java/awt/Choice.java (add):
+        Implement correct selection behavior when peer == null.
+        (insert): Likewise.
+        (remove): Likewise.
+
+2004-10-27  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/gnu/java/awt/peer/gtk/GtkChoicePeer.java:
         Resynced with GNU Classpath.
 
Index: kaffe/libraries/javalib/java/awt/Choice.java
diff -u kaffe/libraries/javalib/java/awt/Choice.java:1.2 kaffe/libraries/javalib/java/awt/Choice.java:1.3
--- kaffe/libraries/javalib/java/awt/Choice.java:1.2	Thu Jul 22 19:20:21 2004
+++ kaffe/libraries/javalib/java/awt/Choice.java	Wed Oct 27 19:08:27 2004
@@ -1,5 +1,5 @@
 /* Choice.java -- Java choice button widget.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -169,6 +169,8 @@
       ChoicePeer cp = (ChoicePeer) peer;
       cp.add (item, i);
     }
+  else if (selectedIndex == -1) 
+    select(0);
 }
 
 /*************************************************************************/
@@ -218,6 +220,8 @@
       ChoicePeer cp = (ChoicePeer) peer;
       cp.add (item, index);
     }
+  else if (selectedIndex == -1 || selectedIndex >= index)
+    select(0);
 }
 
 /*************************************************************************/
@@ -260,6 +264,13 @@
     {
       ChoicePeer cp = (ChoicePeer) peer;
       cp.remove (index);
+    }
+  else
+    {
+      if (getItemCount() == 0)
+	selectedIndex = -1;
+      else if (index == selectedIndex)
+	select(0);
     }
 
   if (selectedIndex > index)




More information about the kaffe mailing list