Here comes a fixlet for FlowView which adds a check for a bordercase.

2006-03-03  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/text/FlowView.java
        (FlowStrategy.layoutRow): Added check for rowCount == 0.
        (FlowStrategy.getLogicalView): Made method protected.

/Roman
Index: javax/swing/text/FlowView.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/FlowView.java,v
retrieving revision 1.9
diff -u -r1.9 FlowView.java
--- javax/swing/text/FlowView.java	21 Feb 2006 13:56:15 -0000	1.9
+++ javax/swing/text/FlowView.java	3 Mar 2006 19:37:52 -0000
@@ -127,7 +127,7 @@
      *
      * @return the logical view of the managed <code>FlowView</code>
      */
-    public View getLogicalView(FlowView fv)
+    protected View getLogicalView(FlowView fv)
     {
       return fv.layoutPool;
     }
@@ -210,7 +210,10 @@
           int flowSpan = fv.getFlowSpan(axis);
           adjustRow(fv, rowIndex, flowSpan, flowStart);
           int rowViewCount = row.getViewCount();
-          offset = row.getView(rowViewCount - 1).getEndOffset();
+          if (rowViewCount > 0)
+            offset = row.getView(rowViewCount - 1).getEndOffset();
+          else
+            offset = -1;
         }
       return offset != pos ? offset : -1;
     }

Reply via email to