Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue 8198, 8133 #8229

Merged
merged 6 commits into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/org/jabref/model/metadata/SaveOrderConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public String toString() {
return name;
}

public static SaveOrderConfig.OrderType fromBooleans(boolean saveInSpecifiedOrder, boolean saveInTableOrder) {
SaveOrderConfig.OrderType orderType = SaveOrderConfig.OrderType.ORIGINAL;
public static SaveOrderConfig.OrderType fromBooleans(boolean saveInSpecifiedOrder, boolean saveInOriginalOrder) {
SaveOrderConfig.OrderType orderType = SaveOrderConfig.OrderType.TABLE;
if (saveInSpecifiedOrder) {
orderType = SaveOrderConfig.OrderType.SPECIFIED;
} else if (saveInTableOrder) {
orderType = SaveOrderConfig.OrderType.TABLE;
} else if (saveInOriginalOrder) {
orderType = SaveOrderConfig.OrderType.ORIGINAL;
}

return orderType;
Expand Down Expand Up @@ -67,7 +67,7 @@ private SaveOrderConfig(List<String> data) {
}

try {
this.orderType = OrderType.valueOf(data.get(0));
this.orderType = OrderType.valueOf(data.get(0).toUpperCase());
} catch (IllegalArgumentException ex) {
if (data.size() > 1 && data.size() % 2 == 1) {
LOGGER.warn("Could not parse sort order: {} - trying to parse the sort criteria", data.get(0));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/preferences/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public class JabRefPreferences implements PreferencesService {
public static final String REFORMAT_FILE_ON_SAVE_AND_EXPORT = "reformatFileOnSaveAndExport";
public static final String EXPORT_IN_ORIGINAL_ORDER = "exportInOriginalOrder";
public static final String EXPORT_IN_SPECIFIED_ORDER = "exportInSpecifiedOrder";

public static final String EXPORT_PRIMARY_SORT_FIELD = "exportPriSort";
public static final String EXPORT_PRIMARY_SORT_DESCENDING = "exportPriDescending";
public static final String EXPORT_SECONDARY_SORT_FIELD = "exportSecSort";
Expand Down Expand Up @@ -530,7 +531,7 @@ private JabRefPreferences() {
defaults.put(REFORMAT_FILE_ON_SAVE_AND_EXPORT, Boolean.FALSE);

// export order
defaults.put(EXPORT_IN_ORIGINAL_ORDER, Boolean.FALSE);
defaults.put(EXPORT_IN_ORIGINAL_ORDER, Boolean.TRUE);
defaults.put(EXPORT_IN_SPECIFIED_ORDER, Boolean.FALSE);

// export order: if EXPORT_IN_SPECIFIED_ORDER, then use following criteria
Expand Down