This patch makes us pass
gnu/testlet/javax/swing/JEditorPane/getScrollableTracks.java

We were always returning false for getScrollableTracksViewportWidth (and
Height), the O'Reilly Swing book said we should always return true, but
the Mauve tests indicated that neither of these was right.

Since packing validates the component and packing makes these methods
return true, I've implemented them to return isValid and this passes the
Mauve tests.  I can find no documentation to support this or any other
implementation, so if it's wrong, future test apps will have to show
that and will have to be converted into more specific Mauve test cases.

For now, this is committed.


2005-10-27  Anthony Balkissoon  <[EMAIL PROTECTED]>

        * javax/swing/JEditorPane.java:
        (getScrollableTracksViewportWidth): Return true if the component is 
        valid.
        (getScrollableTracksViewportHeight): Likewise.

--Tony
Index: javax/swing/JEditorPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JEditorPane.java,v
retrieving revision 1.24
diff -u -r1.24 JEditorPane.java
--- javax/swing/JEditorPane.java	19 Oct 2005 15:24:15 -0000	1.24
+++ javax/swing/JEditorPane.java	27 Oct 2005 20:26:22 -0000
@@ -571,12 +571,18 @@
 
   public boolean getScrollableTracksViewportHeight()
   {
-    return false;
+  /*  Container parent = getParent();
+    return (parent instanceof JViewport &&
+        parent.isValid());*/
+    return isValid();
   }
 
   public boolean getScrollableTracksViewportWidth()
   {
-    return false;
+    /*Container parent = getParent();
+    return (parent instanceof JViewport &&
+        parent.isValid());*/
+    return isValid();
   }
 
   public URL getPage()
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to