Ignore:
Timestamp:
2017-10-29T14:57:41+01:00 (2 years ago)
Author:
Don-vip
Message:

fix #14602 - allow both dot and comma decimal separator everywhere possible for user-entered values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java

    r13047 r13050  
    3939import org.openstreetmap.josm.tools.GBC;
    4040import org.openstreetmap.josm.tools.ImageProvider;
     41import org.openstreetmap.josm.tools.JosmDecimalFormatSymbolsProvider;
    4142import org.openstreetmap.josm.tools.Logging;
    4243
     
    263264            if (layer != null && semicolon >= 0 && semicolon + 1 < ostr.length()) {
    264265                try {
    265                     // here we assume that Double.parseDouble() needs '.' as a decimal separator
    266                     String easting = ostr.substring(0, semicolon).trim().replace(',', '.');
    267                     String northing = ostr.substring(semicolon + 1).trim().replace(',', '.');
    268                     double dx = Double.parseDouble(easting);
    269                     double dy = Double.parseDouble(northing);
     266                    String easting = ostr.substring(0, semicolon).trim();
     267                    String northing = ostr.substring(semicolon + 1).trim();
     268                    double dx = JosmDecimalFormatSymbolsProvider.parseDouble(easting);
     269                    double dy = JosmDecimalFormatSymbolsProvider.parseDouble(northing);
    270270                    tempOffset.setDisplacement(new EastNorth(dx, dy));
    271271                    layer.getDisplaySettings().setOffsetBookmark(tempOffset);
Note: See TracChangeset for help on using the changeset viewer.