Committed this to fix a problem Lillian found. If a component is not
valid then getBounds could not be trusted when calculating the
preferredSpan.
I realise now that this patch may not be the proper way to implement the
solution, the solution should probably be from calls to
preferenceChanged, I'll look into this immediately.
2005-11-02 Anthony Balkissoon <[EMAIL PROTECTED]>
* javax/swing/text/WrappedPlainView.java:
(calculateBreakPosition): If the component is not valid use it's
preferredSize instead of getBounds().
--Tony
Index: javax/swing/text/WrappedPlainView.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/WrappedPlainView.java,v
retrieving revision 1.3
diff -u -r1.3 WrappedPlainView.java
--- javax/swing/text/WrappedPlainView.java 31 Oct 2005 21:29:52 -0000 1.3
+++ javax/swing/text/WrappedPlainView.java 2 Nov 2005 19:05:38 -0000
@@ -226,7 +226,8 @@
protected int calculateBreakPosition(int p0, int p1)
{
Container c = getContainer();
- Rectangle alloc = c.getBounds();
+ Rectangle alloc = c.isValid() ? c.getBounds()
+ : new Rectangle(c.getPreferredSize());
updateMetrics();
try
{
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches