Changeset 3570 in josm


Ignore:
Timestamp:
2010-09-30T19:49:36+02:00 (11 years ago)
Author:
stoecker
Message:

fix GPX export action

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

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

    r2842 r3570  
    7373            throw new IllegalArgumentException(MessageFormat.format("Expected instance of OsmDataLayer or GpxLayer. Got ''{0}''.", layer.getClass().getName()));
    7474
    75         File file = createAndOpenSaveFileChooser(tr("Export GPX file"), ".gpx");
     75        File file = createAndOpenSaveFileChooser(tr("Export GPX file"), "gpx");
    7676        if (file == null)
    7777            return;
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r3336 r3570  
    188188
    189189        File file = fc.getSelectedFile();
    190         if(extension != null){
    191             String fn = file.getPath();
    192             if(fn.indexOf('.') == -1)
    193             {
    194                 FileFilter ff = fc.getFileFilter();
    195                 if (ff instanceof ExtensionFileFilter) {
    196                     fn += "." + ((ExtensionFileFilter)ff).getDefaultExtension();
    197                 } else {
    198                     fn += extension;
    199                 }
    200                 file = new File(fn);
    201             }
     190        String fn = file.getPath();
     191        if(fn.indexOf('.') == -1)
     192        {
     193            FileFilter ff = fc.getFileFilter();
     194            if (ff instanceof ExtensionFileFilter) {
     195                fn += "." + ((ExtensionFileFilter)ff).getDefaultExtension();
     196            } else if(extension != null) {
     197                fn += "." + extension;
     198            }
     199            file = new File(fn);
    202200        }
    203201        if(file == null || (file.exists())) {
Note: See TracChangeset for help on using the changeset viewer.