I had to fix the condition in ViewportLayout.layoutContainer() again, in
order to avoid a ClasscastException.

2006-01-10  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/ViewportLayout.java
        (layoutContainer): Fixed condition, to avoid ClasscastException.

/Roman
Index: javax/swing/ViewportLayout.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/ViewportLayout.java,v
retrieving revision 1.22
diff -u -r1.22 ViewportLayout.java
--- javax/swing/ViewportLayout.java	10 Jan 2006 13:09:24 -0000	1.22
+++ javax/swing/ViewportLayout.java	10 Jan 2006 13:33:17 -0000
@@ -146,7 +146,8 @@
 
     // vertical implementation of the above rules
     if ((! (view instanceof Scrollable) && viewPref.height < portBounds.height
-         || ((Scrollable) view).getScrollableTracksViewportHeight()))
+         || (view instanceof Scrollable
+            && ((Scrollable) view).getScrollableTracksViewportHeight())))
       viewPref.height = portBounds.height;
 
     if (portBounds.height >= viewMinimum.height)
@@ -160,7 +161,8 @@
 
     // horizontal implementation of the above rules
     if ((! (view instanceof Scrollable) && viewPref.width < portBounds.width
-         || ((Scrollable) view).getScrollableTracksViewportWidth()))
+         || (view instanceof Scrollable
+         && ((Scrollable) view).getScrollableTracksViewportWidth())))
       viewPref.width = portBounds.width;
 
     if (portBounds.width >= viewMinimum.width)
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to