Hi,
In a couple of places TableView does already check whether the rowView
used is actually an instance of RowView, but not in all places. This
patches fixes that:
2006-11-25 Mark Wielaard <[EMAIL PROTECTED]>
* javax/swing/text/html/TableView.java (calculateColumnRequirements):
Check whether rowView instanceof RowView.
(updateGrid): Likewise.
This makes the suse coolblogs render better.
Committed,
Mark
Index: javax/swing/text/html/TableView.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/html/TableView.java,v
retrieving revision 1.9
diff -u -r1.9 TableView.java
--- javax/swing/text/html/TableView.java 20 Nov 2006 11:18:04 -0000 1.9
+++ javax/swing/text/html/TableView.java 25 Nov 2006 18:43:57 -0000
@@ -427,8 +427,12 @@
// all columns of all rows.
for (int r = 0; r < numRows; r++)
{
- RowView rowView = (RowView) getView(r);
- int numCols = rowView.getViewCount();
+ View rowView = getView(r);
+ int numCols;
+ if (rowView instanceof RowView)
+ numCols = ((RowView) rowView).getViewCount();
+ else
+ numCols = 0;
// We collect the normal (non-relative) column requirements in the
// total variable and the relative requirements in the relTotal
@@ -665,15 +669,23 @@
int numRows = getViewCount();
for (int r = 0; r < numRows; r++)
{
- RowView rowView = (RowView) getView(r);
- int numCols = rowView.getViewCount();
+ View rowView = getView(r);
+ int numCols;
+ if (rowView instanceof RowView)
+ numCols = ((RowView) rowView).getViewCount();
+ else
+ numCols = 0;
maxColumns = Math.max(numCols, maxColumns);
}
columnWidths = new Length[maxColumns];
for (int r = 0; r < numRows; r++)
{
- RowView rowView = (RowView) getView(r);
- int numCols = rowView.getViewCount();
+ View rowView = getView(r);
+ int numCols;
+ if (rowView instanceof RowView)
+ numCols = ((RowView) rowView).getViewCount();
+ else
+ numCols = 0;
int colIndex = 0;
for (int c = 0; c < numCols; c++)
{