summaryrefslogtreecommitdiff
path: root/javax
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-11-25 18:45:05 +0000
committerMark Wielaard <mark@klomp.org>2006-11-25 18:45:05 +0000
commit276707783cc7f4ee9ea55c7f1dfcb0b2192db392 (patch)
tree52c7714f584960bfb92f530f2de3487e6337f76b /javax
parentbe3692e63addd7cbb0a56642358406765ad9227e (diff)
downloadclasspath-276707783cc7f4ee9ea55c7f1dfcb0b2192db392.tar.gz
* javax/swing/text/html/TableView.java (calculateColumnRequirements):
Check whether rowView instanceof RowView. (updateGrid): Likewise.
Diffstat (limited to 'javax')
-rw-r--r--javax/swing/text/html/TableView.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/javax/swing/text/html/TableView.java b/javax/swing/text/html/TableView.java
index 376d640e7..971d54cb6 100644
--- a/javax/swing/text/html/TableView.java
+++ b/javax/swing/text/html/TableView.java
@@ -427,8 +427,12 @@ class TableView
// 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 @@ class TableView
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++)
{