$OpenBSD: patch-jdk_src_share_classes_javax_swing_text_WrappedPlainView_java,v 1.1 2008/03/21 02:46:43 kurt Exp $
--- jdk/src/share/classes/javax/swing/text/WrappedPlainView.java.orig	Sat Dec  1 00:00:00 2007
+++ jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Thu Mar 20 14:10:58 2008
@@ -236,9 +236,6 @@ public class WrappedPlainView extends BoxView implemen
         Segment segment = SegmentCache.getSharedSegment();
         loadText(segment, p0, p1);
         int currentWidth = getWidth();
-        if (currentWidth == Integer.MAX_VALUE) {
-            currentWidth = (int) getDefaultSpan(View.X_AXIS);
-        }
         if (wordWrap) {
             p = p0 + Utilities.getBreakLocation(segment, metrics,
                                                 tabBase, tabBase + currentWidth,
@@ -324,20 +321,6 @@ public class WrappedPlainView extends BoxView implemen
         tabSize = getTabSize() * metrics.charWidth('m');
     }
 
-    /**
-     * Return reasonable default values for the view dimensions.  The standard
-     * text terminal size 80x24 is pretty suitable for the wrapped plain view.
-     */
-    private float getDefaultSpan(int axis) {
-         switch (axis) {
-            case View.X_AXIS:
-                return 80 * metrics.getWidths()['M'];
-            case View.Y_AXIS:
-                return 24 * metrics.getHeight();
-            default:
-                throw new IllegalArgumentException("Invalid axis: " + axis);
-        }
-    }
 
     // --- TabExpander methods ------------------------------------------
 
@@ -573,19 +556,16 @@ public class WrappedPlainView extends BoxView implemen
                 if (width == Integer.MAX_VALUE) {
                     // We have been initially set to MAX_VALUE, but we don't
                     // want this as our preferred.
-                    width = getDefaultSpan(axis);
+                    return 100f;
                 }
                 return width;
             case View.Y_AXIS:
-                if (getDocument().getLength() > 0) {
-                    if ((lineCount < 0) || widthChanging) {
-                        breakLines(getStartOffset());
-                    }
-                    return lineCount * metrics.getHeight();
-                } else {
-                    return getDefaultSpan(axis);
-                }
-            default:
+            	if (lineCount < 0 || widthChanging) {
+                   breakLines(getStartOffset());
+               }
+                int h = lineCount * metrics.getHeight();
+                return h;
+	    default:
                 throw new IllegalArgumentException("Invalid axis: " + axis);
             }
         }
