On Tue, 2006-02-28 at 20:03 +0100, Roman Kennke wrote:
> Hi Lillian,
>
> Am Dienstag, den 28.02.2006, 13:15 -0500 schrieb Lillian Angel:
> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26003
> > Audrius submitted this patch in the bug report for #26003. It fixes a
> > problem with the viewport layout. This bug was seen with JTrees. The
> > viewport would reset to (0,0) everytime a node was expanded.
>
> This patch causes a regression in Mauve (see below). And, IIRC, I
> already handled this bug and maybe forgot to close it. Could you check
> this again?
>
> gnu.testlet.javax.swing.ViewportLayout.layoutContainer
> ----
> PASS: gnu.testlet.javax.swing.ViewportLayout.layoutContainer (number 1)
> PASS: gnu.testlet.javax.swing.ViewportLayout.layoutContainer (number 2)
> FAIL: gnu.testlet.javax.swing.ViewportLayout.layoutContainer (number 3)
> got java.awt.Dimension[width=100,height=100] but expected
> java.awt.Dimension[width=50,height=50]
> PASS: gnu.testlet.javax.swing.ViewportLayout.layoutContainer (number 4)
> 1 of 4 tests failed
>
Unfortunately, without Audrius' patch, #3 fails. With it, #4 failed.
I fixed it so all the tests pass.
2006-02-28 Lillian Angel <[EMAIL PROTECTED]>
* javax/swing/ViewportLayout.java
(layoutContainer): Should not extend container to be
minimum size. Mauve test shows that the preferred size
and the size of the viewport can be set smaller than
the minimum.
Index: javax/swing/ViewportLayout.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/ViewportLayout.java,v
retrieving revision 1.25
diff -u -r1.25 ViewportLayout.java
--- javax/swing/ViewportLayout.java 28 Feb 2006 18:14:12 -0000 1.25
+++ javax/swing/ViewportLayout.java 28 Feb 2006 20:08:29 -0000
@@ -193,18 +193,6 @@
if (overextension > 0)
portBounds.x -= overextension;
- // If the calculated view size was smaller than the minimum size,
- // extend till the minimum size.
- if (viewPref.height<viewMinimum.height)
- {
- viewPref.height = viewMinimum.height;
- }
-
- if (viewPref.width<viewMinimum.width)
- {
- viewPref.width = viewMinimum.width;
- }
-
port.setViewSize(viewPref);
port.setViewPosition(portBounds.getLocation());
}