Changeset 8581 in josm
- Timestamp:
- 2015-07-07T23:45:23+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r8510 r8581 31 31 * 32 32 */ 33 @SuppressWarnings("serial")34 33 public class TagEditorModel extends AbstractTableModel { 35 34 public static final String PROP_DIRTY = TagEditorModel.class.getName() + ".dirty"; … … 407 406 */ 408 407 public void applyToPrimitive(Tagged primitive) { 409 Map<String, String> tags = primitive.getKeys(); 410 applyToTags(tags, false); 411 primitive.setKeys(tags); 408 primitive.setKeys(applyToTags(false)); 412 409 } 413 410 … … 415 412 * applies the current state of the tag editor model to a map of tags 416 413 * 417 * @param tags the map of key/value pairs 418 * 419 */ 420 public void applyToTags(Map<String, String> tags, boolean keepEmpty) { 421 tags.clear(); 414 * @return the map of key/value pairs 415 */ 416 private Map<String, String> applyToTags(boolean keepEmpty) { 417 Map<String, String> result = new HashMap<>(); 422 418 for (TagModel tag: this.tags) { 423 419 // tag still holds an unchanged list of different values for the same key. … … 432 428 continue; 433 429 } 434 tags.put(tag.getName().trim(), tag.getValue().trim()); 435 } 430 result.put(tag.getName().trim(), tag.getValue().trim()); 431 } 432 return result; 436 433 } 437 434 … … 441 438 442 439 public Map<String, String> getTags(boolean keepEmpty) { 443 Map<String, String> tags = new HashMap<>(); 444 applyToTags(tags, keepEmpty); 445 return tags; 440 return applyToTags(keepEmpty); 446 441 } 447 442
Note:
See TracChangeset
for help on using the changeset viewer.