Ignore:
Timestamp:
2009-08-02T19:13:42+02:00 (15 years ago)
Author:
jttt
Message:

Fix ArrayIndexOutOfBoundsException 0:-2 in relation editor when Shift-Tab is pressed in table without selected cell

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

    r1868 r1884  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.dialogs.relation;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46import java.awt.event.ActionEvent;
     
    2527import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;
    2628
    27 import static org.openstreetmap.josm.tools.I18n.tr;
    28 
    2929public class MemberTable extends JTable implements IMemberModelListener {
    3030
     
    3939    /**
    4040     * constructor
    41      * 
     41     *
    4242     * @param model
    4343     * @param columnModel
     
    7575     * adjusts the width of the columns for the tag name and the tag value to the width of the
    7676     * scroll panes viewport.
    77      * 
     77     *
    7878     * Note: {@see #getPreferredScrollableViewportSize()} did not work as expected
    79      * 
     79     *
    8080     * @param scrollPaneWidth the width of the scroll panes viewport
    8181     */
     
    104104     * <li>it jumps over cells in the first column</li> <li>it automatically add a new empty row
    105105     * when the user leaves the last cell in the table</li> <ul>
    106      * 
    107      * 
     106     *
     107     *
    108108     */
    109109    class SelectNextColumnCellAction extends AbstractAction {
     
    132132     * Action to be run when the user navigates to the previous cell in the table, for instance by
    133133     * pressing Shift-TAB
    134      * 
     134     *
    135135     */
    136136    class SelectPreviousColumnCellAction extends AbstractAction {
     
    143143            }
    144144
    145             if (col == 0 && row == 0) {
     145            if (col <= 0 && row <= 0) {
    146146                // change nothing
    147147            } else if (row > 0) {
     
    166166    /**
    167167     * Replies the popup menu for this table
    168      * 
     168     *
    169169     * @return the popup menu
    170170     */
Note: See TracChangeset for help on using the changeset viewer.