Ticket #12369: SaveExtensionCheckFileFilter.patch

File SaveExtensionCheckFileFilter.patch, 796 bytes (added by kolesar, 5 years ago)
  • src/org/openstreetmap/josm/actions/SaveActionBase.java

    diff --git a/src/org/openstreetmap/josm/actions/SaveActionBase.java b/src/org/openstreetmap/josm/actions/SaveActionBase.java
    index 9e6035f..e52138b 100644
    a b public abstract class SaveActionBase extends DiskAccessAction { 
    197197            }
    198198            // No filefilter accepts current filename, add default extension
    199199            String fn = file.getPath();
    200             if (extension != null) {
     200            if (extension != null && ff.accept(new File(fn + '.' + extension))) {
    201201                fn += '.' + extension;
    202202            } else if (ff instanceof ExtensionFileFilter) {
    203203                fn += '.' + ((ExtensionFileFilter) ff).getDefaultExtension();