Skip to content

Commit

Permalink
Added trim to check
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed May 28, 2020
1 parent f21a540 commit 122b746
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ public void bindToEntry(BibEntry entry) {
fieldBinding,
newValue -> {
if (newValue != null) {
String oldValue = entry.getField(field).orElse(null);
if (!newValue.equals(oldValue)) {
entry.setField(field, newValue);
UndoManager undoManager = JabRefGUI.getMainFrame().getUndoManager();
undoManager.addEdit(new UndoableFieldChange(entry, field, oldValue, newValue));
}
entry.getField(field).ifPresent(oldValue -> {
if (!(newValue.trim()).equals(oldValue.trim())) {
entry.setField(field, newValue);
UndoManager undoManager = JabRefGUI.getMainFrame().getUndoManager();
undoManager.addEdit(new UndoableFieldChange(entry, field, oldValue, newValue));
}
});
}
});
}
Expand Down

0 comments on commit 122b746

Please sign in to comment.