Changeset 9279 in osm
- Timestamp:
- 2008-07-24T16:10:03+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/TagChecker.java
r9269 r9279 90 90 protected JButton deleteSrcButton; 91 91 92 /** Empty values error */ 93 protected static int EMPTY_VALUES = 0; 94 /** Invalid key error */ 95 protected static int INVALID_KEY = 1; 96 /** Invalid value error */ 97 protected static int INVALID_VALUE = 2; 98 /** fixme error */ 99 protected static int FIXME = 3; 100 92 protected static int EMPTY_VALUES = 0; /** Empty values error */ 93 protected static int INVALID_KEY = 1; /** Invalid key error */ 94 protected static int INVALID_VALUE = 2; /** Invalid value error */ 95 protected static int FIXME = 3; /** fixme error */ 96 protected static int INVALID_SPACE = 3; /** space in value (start/end) */ 97 101 98 /** List of sources for spellcheck data */ 102 99 protected JList Sources; … … 138 135 spellCheckKeyData = new HashMap<String, String>(); 139 136 String sources = Main.pref.get( PREF_SOURCES ); 140 //if(Main.pref.getBoolean(PREF_USE_DATA_FILE))141 //{142 //if( sources == null || sources.length() == 0)143 //sources = DATA_FILE;144 //else145 //sources = DATA_FILE + ";" + sources;146 //}137 if(Main.pref.getBoolean(PREF_USE_DATA_FILE)) 138 { 139 if( sources == null || sources.length() == 0) 140 sources = DATA_FILE; 141 else 142 sources = DATA_FILE + ";" + sources; 143 } 147 144 if(Main.pref.getBoolean(PREF_USE_SPELL_FILE)) 148 145 { … … 262 259 if( checkValues && value != null && (value.startsWith(" ") || value.endsWith(" ")) && !withErrors.contains(p, "SPACE")) 263 260 { 264 errors.add( new TestError(this, Severity.OTHER, tr("Property values start or end with white space"), p, INVALID_ VALUE) );261 errors.add( new TestError(this, Severity.OTHER, tr("Property values start or end with white space"), p, INVALID_SPACE) ); 265 262 withErrors.add(p, "SPACE"); 266 263 } … … 509 506 testPanel.add(prefUseDataFile, GBC.eol().insets(20,0,0,0)); 510 507 511 boolean useSpellFile = Main.pref.getBoolean(PREF_USE_ DATA_FILE, true);508 boolean useSpellFile = Main.pref.getBoolean(PREF_USE_SPELL_FILE, true); 512 509 JCheckBox prefUseSpellFile = new JCheckBox(tr("Use default spellcheck file."), checkValues); 513 510 prefUseSpellFile.setToolTipText(tr("Use the default spellcheck file (recommended).")); … … 527 524 Main.pref.put(PREF_CHECK_KEYS_BEFORE_UPLOAD, prefCheckKeysBeforeUpload.isSelected()); 528 525 Main.pref.put(PREF_CHECK_FIXMES_BEFORE_UPLOAD, prefCheckFixmesBeforeUpload.isSelected()); 526 Main.pref.put(PREF_USE_DATA_FILE, prefCheckFixmesBeforeUpload.isSelected()); 527 Main.pref.put(PREF_USE_SPELL_FILE, prefCheckFixmesBeforeUpload.isSelected()); 529 528 String sources = ""; 530 529 if( Sources.getModel().getSize() > 0 ) … … 558 557 if( value == null || value.trim().length() == 0 ) 559 558 commands.add( new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, null) ); 559 else if(value.startsWith(" ") || value.endsWith(" ")) 560 commands.add( new ChangePropertyCommand(Collections.singleton(primitives.get(i)), key, value.trim()) ); 560 561 else 561 562 { 562 563 String replacementKey = spellCheckKeyData.get(key); 563 564 if( replacementKey != null ) 564 commands.add( new ChangePropertyKeyCommand(Collections.singleton(primitives.get(i)), key, replacementKey) ); 565 commands.add( new ChangePropertyKeyCommand(Collections.singleton(primitives.get(i)), key, replacementKey) ); 565 566 } 566 567 } … … 581 582 { 582 583 int code = testError.getInternalCode(); 583 return code == INVALID_KEY || code == EMPTY_VALUES ;584 return code == INVALID_KEY || code == EMPTY_VALUES || code == INVALID_SPACE; 584 585 } 585 586
Note:
See TracChangeset
for help on using the changeset viewer.