Browse Source

cpt与cptx另存为文件名异常

feature/big-screen
Maksim 5 years ago
parent
commit
8f8228e8b2
  1. 11
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java

11
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -505,12 +505,21 @@ public class FILEChooserPane extends BasicPane {
if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) {
return fileName;
}
if (!ComparatorUtils.equals(fileNameExtension, filterExtension)) {
if (!ComparatorUtils.equals(fileNameExtension, filterExtension) && !isMapping(fileNameExtension, filterExtension)) {
return fileName + filterExtension;
}
return fileNameWithOutExtension + filterExtension;
}
private boolean isMapping(String fromExtension, String toExtension){
if(FileExtension.CPTX.matchExtension(fromExtension)){
return FileExtension.CPT.matchExtension(toExtension);
}else if(FileExtension.CPT.matchExtension(fromExtension)){
return FileExtension.CPTX.matchExtension(toExtension);
}
return false;
}
private void doCancel() {
this.locationBtnPane.setPopDir(null);
dialogExit();

Loading…
Cancel
Save