[cp-patches] Patch: BoxLayout fix

2005-12-06 Thread Anthony Balkissoon
2005-12-06  Anthony Balkissoon  [EMAIL PROTECTED]

Fixes bug #25233
* javax/swing/BoxLayout.java:
(maximumLayoutSize): Don't add the Insets to the Dimension calculated 
in checkTotalRequirements().



___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] Patch: BoxLayout fix

2005-12-06 Thread Anthony Balkissoon
This patch fixes PR 25233.

2005-12-06  Anthony Balkissoon  [EMAIL PROTECTED]

Fixes bug #25233
* javax/swing/BoxLayout.java:
(maximumLayoutSize): Don't add the Insets to the Dimension calculated 
in checkTotalRequirements().

--Tony
Index: javax/swing/BoxLayout.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/BoxLayout.java,v
retrieving revision 1.25
diff -u -r1.25 BoxLayout.java
--- javax/swing/BoxLayout.java	2 Nov 2005 11:47:57 -	1.25
+++ javax/swing/BoxLayout.java	6 Dec 2005 19:34:56 -
@@ -334,9 +334,8 @@
   throw new AWTError(BoxLayout can't be shared);
 
 checkTotalRequirements();
-Insets i = container.getInsets();
-return new Dimension(xTotal.maximum + i.left + i.right,
- yTotal.maximum + i.top + i.bottom);
+return new Dimension(xTotal.maximum,
+ yTotal.maximum);
   }
   }
 
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] Patch: BoxLayout fix

2005-12-06 Thread Anthony Balkissoon
I reverted this patch because it caused a Mauve regression.  I'll have
to write more tests and figure out what was wrong.

regression: gnu.testlet.javax.swing.BoxLayout.maximumLayoutSize

On Tue, 2005-12-06 at 14:52 -0500, Anthony Balkissoon wrote:
 This patch fixes PR 25233.
 
 2005-12-06  Anthony Balkissoon  [EMAIL PROTECTED]
 
   Fixes bug #25233
   * javax/swing/BoxLayout.java:
   (maximumLayoutSize): Don't add the Insets to the Dimension calculated 
   in checkTotalRequirements().
 
 --Tony
 ___
 Classpath-patches mailing list
 Classpath-patches@gnu.org
 http://lists.gnu.org/mailman/listinfo/classpath-patches

--Tony



___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] Patch: BoxLayout fix

2005-12-06 Thread Anthony Balkissoon
On Tue, 2005-12-06 at 15:58 -0500, Anthony Balkissoon wrote:
 I reverted this patch because it caused a Mauve regression.  I'll have
 to write more tests and figure out what was wrong.
 
 regression: gnu.testlet.javax.swing.BoxLayout.maximumLayoutSize
 

Okay, here's the new patch.  It doesn't cause the regression and also
makes us pass the new test:
gnu.testlet.javax.swing.BoxLayout.maximumLayoutSize2

Patch simply involves checking for overflow.

2005-12-06  Anthony Balkissoon  [EMAIL PROTECTED] 

* javax/swing/BoxLayout.java:
(maximumLayoutSize): Add Insets to Dimension and then check for 
overflow.

--Tony
Index: javax/swing/BoxLayout.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/BoxLayout.java,v
retrieving revision 1.26
diff -u -r1.26 BoxLayout.java
--- javax/swing/BoxLayout.java	6 Dec 2005 19:50:23 -	1.26
+++ javax/swing/BoxLayout.java	6 Dec 2005 21:25:01 -
@@ -334,8 +334,16 @@
   throw new AWTError(BoxLayout can't be shared);
 
 checkTotalRequirements();
-return new Dimension(xTotal.maximum,
- yTotal.maximum);
+Insets i = container.getInsets();
+int xDim = xTotal.maximum + i.left + i.right;
+int yDim = yTotal.maximum + i.top + i.bottom;
+
+// Check for overflow
+if (xDim  xTotal.maximum)
+  xDim = Integer.MAX_VALUE;
+if (yDim  yTotal.maximum)
+  yDim = Integer.MAX_VALUE;
+return new Dimension(xDim, yDim);
   }
   }
 
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches