diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-18 00:59:33 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-18 00:59:33 +0000 |
commit | 15d27402f51cf831d82aa31271f5c01855b4f2cf (patch) | |
tree | 4c44aaa3ed1ee1b4f15732664c05cfc9214e1fa9 /libjava/classpath/javax/swing/plaf/basic/BasicListUI.java | |
parent | 820206ad46c6fc0131d5771ec1051267022e875d (diff) | |
download | ppe42-gcc-15d27402f51cf831d82aa31271f5c01855b4f2cf.tar.gz ppe42-gcc-15d27402f51cf831d82aa31271f5c01855b4f2cf.zip |
Imported GNU Classpath gcj-import-20051117.
* gnu/java/net/protocol/file/Connection.java: Removed, fully merged.
* sources.am: Regenerated.
* Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107153 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/swing/plaf/basic/BasicListUI.java')
-rw-r--r-- | libjava/classpath/javax/swing/plaf/basic/BasicListUI.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java b/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java index 33932991473..2d66645fb7d 100644 --- a/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java +++ b/libjava/classpath/javax/swing/plaf/basic/BasicListUI.java @@ -703,12 +703,17 @@ public class BasicListUI extends ListUI */ protected int getRowHeight(int row) { - if (row < 0 || row >= cellHeights.length) - return -1; - else if (cellHeight != -1) - return cellHeight; + int height; + if (cellHeights == null) + height = cellHeight; else - return cellHeights[row]; + { + if (row < 0 || row >= cellHeights.length) + height = -1; + else + height = cellHeights[row]; + } + return height; } /** @@ -803,9 +808,7 @@ public class BasicListUI extends ListUI // If a fixed cell height is set, then we can work more efficient. if (cellHeight > 0) - { - index = Math.max(y0 / cellHeight, index); - } + index = Math.min(y0 / cellHeight, index); // If we have no fixed cell height, we must add up each cell height up // to y0. else @@ -992,8 +995,7 @@ public class BasicListUI extends ListUI */ protected void installKeyboardActions() { - UIDefaults defaults = UIManager.getLookAndFeelDefaults(); - InputMap focusInputMap = (InputMap)defaults.get("List.focusInputMap"); + InputMap focusInputMap = (InputMap) UIManager.get("List.focusInputMap"); InputMapUIResource parentInputMap = new InputMapUIResource(); // FIXME: The JDK uses a LazyActionMap for parentActionMap ActionMap parentActionMap = new ActionMapUIResource(); |