Changeset 4132 in josm


Ignore:
Timestamp:
2011-06-10T08:07:58+02:00 (8 years ago)
Author:
stoecker
Message:

fix #6430 - fix autocompletion for numbers

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CONTRIBUTION

    r3771 r4132  
    3434GPL. The world image is from onearth.pl.
    3535
    36 The gettext-commons-0.9.jar is from Felix Berger and Steffen
    37 Pingel (http://xnap-commons.sourceforge.net/gettext-commons/).
    38 The jar file is licensed under LGPL.
    39 
    4036The Bzip2 code is from Keiron Liddle (Apache project) and licensed
    4137with Apache license version 2.0.
  • trunk/README

    r3439 r4132  
    3535Under Linux open a shell, go to the file directory and type
    3636"java -jar josm-latest.jar" to launch. If this don't help, try to set
    37 you JAVA_HOME variable to the java location (the root location, not
     37your JAVA_HOME variable to the java location (the root location, not
    3838the bin)
    3939
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java

    r4018 r4132  
    7070            String curText = getText(0, size);
    7171
    72             // if the text starts with a number we don't autocomplete
     72            // item for lookup and selection
     73            Object item = null;
     74            // if the text is a number we don't autocomplete
    7375            if (Main.pref.getBoolean("autocomplete.dont_complete_numbers", true)) {
    7476                try {
    7577                    Long.parseLong(str);
    76                     if (curText.length() == 0)
    77                         // we don't autocomplete on numbers
    78                         return;
    79                     Long.parseLong(curText);
    80                     return;
     78                    if (curText.length() != 0)
     79                        Long.parseLong(curText);
    8180                } catch (NumberFormatException e) {
    8281                    // either the new text or the current text isn't a number. We continue with
    8382                    // autocompletion
    84                 }
    85             }
    86 
    87             // lookup and select a matching item
    88             Object item = lookupItem(curText);
     83                    item = lookupItem(curText);
     84                }
     85            } else {
     86                item = lookupItem(curText);
     87            }
     88
    8989            setSelectedItem(item);
    9090            if (initial) {
Note: See TracChangeset for help on using the changeset viewer.