Hey,

This patch fixes a bug in java.awt.FlowLayout.getSize(Component) that
was exposed by Harmony's TestSuites.  If the parent does not have a
component, then a different formula is used to calculate the width.
This patch now passes a couple of failing Harmony's tests.  I have
committed a mauve test.

Cheers,
Tania

2006-11-07  Tania Bento  <[EMAIL PROTECTED]>

        * java/awt/FlowLayout.java
        (getSize): If parent does not have a component, then a
        different formula is used to calcuate the width.

Index: java/awt/FlowLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/FlowLayout.java,v
retrieving revision 1.17
diff -u -r1.17 FlowLayout.java
--- java/awt/FlowLayout.java	14 Jul 2006 17:33:34 -0000	1.17
+++ java/awt/FlowLayout.java	7 Nov 2006 17:46:25 -0000
@@ -337,7 +337,10 @@
 
 	Insets ins = parent.getInsets ();
 
-	w += (num + 1) * hgap + ins.left + ins.right;
+        if (num == 0)
+          w += 2 * hgap + ins.left + ins.right;
+        else
+          w += (num + 1) * hgap + ins.left + ins.right;
 	h += 2 * vgap + ins.top + ins.bottom;
 
 	return new Dimension (w, h);

Reply via email to