diff options
author | Mark Wielaard <mark@klomp.org> | 2006-03-09 16:21:34 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2006-03-09 16:21:34 +0000 |
commit | bc4069097641ddb886b5f041dca4d3c880b30fce (patch) | |
tree | 355f4dbc65355942a7280fbd126b3c017901afa5 /javax/swing/plaf/basic/BasicListUI.java | |
parent | 70304821252e8edf5fc6f34e5864d4590d3d6231 (diff) | |
download | classpath-bc4069097641ddb886b5f041dca4d3c880b30fce.tar.gz |
* javax/swing/JList.java (ensureIndexIsVisible): Check whether cell
bounds for index is valid.
* javax/swing/plaf/basic/BasicListUI.java (valueChanged): Likewise.
(paint): Likewise.
(getCellBounds): Update documentation.
Diffstat (limited to 'javax/swing/plaf/basic/BasicListUI.java')
-rw-r--r-- | javax/swing/plaf/basic/BasicListUI.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/javax/swing/plaf/basic/BasicListUI.java b/javax/swing/plaf/basic/BasicListUI.java index 19dfe21f8..5cde9630c 100644 --- a/javax/swing/plaf/basic/BasicListUI.java +++ b/javax/swing/plaf/basic/BasicListUI.java @@ -1,5 +1,5 @@ /* BasicListUI.java -- - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -179,7 +179,8 @@ public class BasicListUI extends ListUI int index1 = e.getFirstIndex(); int index2 = e.getLastIndex(); Rectangle damaged = getCellBounds(list, index1, index2); - list.repaint(damaged); + if (damaged != null) + list.repaint(damaged); } } @@ -716,7 +717,8 @@ public class BasicListUI extends ListUI * @param index2 The last row to incude in the bounds * * @return A rectangle encompassing the range of rows between - * <code>index1</code> and <code>index2</code> inclusive + * <code>index1</code> and <code>index2</code> inclusive, or null + * such a rectangle couldn't be calculated for the given indexes. */ public Rectangle getCellBounds(JList l, int index1, int index2) { @@ -1182,7 +1184,7 @@ public class BasicListUI extends ListUI for (int row = startIndex; row <= endIndex; ++row) { Rectangle bounds = getCellBounds(list, row, row); - if (bounds.intersects(clip)) + if (bounds != null && bounds.intersects(clip)) paintCell(g, row, bounds, render, model, sel, lead); } } |