Skip to content

Commit

Permalink
Only create the undo action if value was changed
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-kolb committed Oct 29, 2015
1 parent cc5db9f commit 60811a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/net/sf/jabref/gui/actions/CleanUpAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import com.jgoodies.forms.builder.FormBuilder;
import com.jgoodies.forms.layout.FormLayout;
import net.sf.jabref.logic.cleanup.PageNumbersCleanup;
import net.sf.jabref.logic.formatter.FieldFormatters;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.model.entry.BibtexEntry;
import net.sf.jabref.logic.util.DOI;
Expand Down Expand Up @@ -451,7 +452,9 @@ private static void doCleanUpPageNumbers(BibtexEntry entry, NamedCompound ce) {
// new value
String newValue = entry.getField("pages");
// undo action
ce.addEdit(new UndoableFieldChange(entry, "pages", oldValue, newValue));
if(!oldValue.equals(newValue)) {
ce.addEdit(new UndoableFieldChange(entry, "pages", oldValue, newValue));
}
}

private static void fixWrongFileEntries(BibtexEntry entry, NamedCompound ce) {
Expand Down

0 comments on commit 60811a5

Please sign in to comment.