Changeset 17883 in osm for applications/editors/josm/plugins/addrinterpolation/src/org
- Timestamp:
- 2009-09-30T22:14:09+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java
r17762 r17883 334 334 // Both end with alpha 335 335 SelectInterpolationMethod("alphabetic"); 336 } 337 336 return; 337 } 338 339 if ( (IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar)) ) { 340 endingChar = Character.toUpperCase(endingChar); 341 if ( (endingChar >= 'A') && (endingChar <= 'Z') ) { 342 // First is a number, last is Latin alpha 343 SelectInterpolationMethod("alphabetic"); 344 } 345 } 338 346 339 347 … … 873 881 char endingChar = endValueString.charAt(endValueString.length()-1); 874 882 875 if ( (IsNumeric("" + startingChar)) || (IsNumeric("" + endingChar)) ) { 883 884 boolean isOk = false; 885 if ( (IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar)) ) { 886 endingChar = Character.toUpperCase(endingChar); 887 if ( (endingChar >= 'A') && (endingChar <= 'Z') ) { 888 // First is a number, last is Latin alpha 889 isOk = true; 890 } 891 } else if ( (!IsNumeric("" + startingChar)) && (!IsNumeric("" + endingChar)) ) { 892 // Both are alpha 893 isOk = true; 894 } 895 if (!isOk) { 876 896 errorMessage = tr("Alphabetic address must end with a letter"); 897 } 898 899 900 // if a number is included, validate that it is the same number 901 if (endValueString.length() > 1) { 902 903 // Get number portion of first item: may or may not have letter suffix 904 String numStart = startValueString.substring(0, startValueString.length()-1); 905 if (IsNumeric(startValueString)) { 906 numStart = startValueString; 907 } 908 909 String numEnd = endValueString.substring(0, endValueString.length()-1); 910 if (!numStart.equals(numEnd)) { 911 errorMessage = tr("Starting and ending numbers must be the same for alphabetic addresses"); 912 } 877 913 } 878 914
Note:
See TracChangeset
for help on using the changeset viewer.