Ignore:
Timestamp:
06.02.2010 17:37:52 (2 years ago)
Author:
bastiK
Message:

autocompletion: Always add the preset keys/values to the autocompletion list.
Does not apply to the Properties dialog, because it has a seperate implementation of the autocompletion feature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionList.java

    r2512 r2946  
    157157        } else { 
    158158            // new item already exists. Update priority if necessary 
    159             // 
    160             if (toadd.getPriority().compareTo(item.getPriority()) < 0) { 
    161                 item.setPriority(toadd.getPriority()); 
     159 
     160            // If it is both in the dataset and in the presets, update the priority. 
     161            final AutoCompletionItemPritority IS_IN_DATASET = AutoCompletionItemPritority.IS_IN_DATASET; 
     162            final AutoCompletionItemPritority IS_IN_STANDARD = AutoCompletionItemPritority.IS_IN_STANDARD; 
     163            if ((toadd.getPriority() == IS_IN_STANDARD && item.getPriority() == IS_IN_DATASET) || 
     164                (toadd.getPriority() == IS_IN_DATASET && item.getPriority() == IS_IN_STANDARD)) { 
     165 
     166                item.setPriority(AutoCompletionItemPritority.IS_IN_STANDARD_AND_IN_DATASET); 
     167            } else { 
     168                if (toadd.getPriority().compareTo(item.getPriority()) < 0) { 
     169                    item.setPriority(toadd.getPriority()); 
     170                } 
    162171            } 
    163172        } 
Note: See TracChangeset for help on using the changeset viewer.