Skip to content

Commit

Permalink
Pass database to doCleanup to enable resolving of crossref fields at …
Browse files Browse the repository at this point in the history
…file renaming
  • Loading branch information
koppor committed Feb 28, 2016
1 parent a3d6253 commit 3f02cfb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/net/sf/jabref/gui/actions/CleanupAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import net.sf.jabref.logic.cleanup.CleanupPreset;
import net.sf.jabref.logic.cleanup.CleanupWorker;
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.model.database.BibDatabase;
import net.sf.jabref.model.entry.BibEntry;

import javax.swing.*;
Expand Down Expand Up @@ -103,7 +104,7 @@ public void run() {
// undo granularity is on entry level
NamedCompound ce = new NamedCompound(Localization.lang("Cleanup entry"));

doCleanup(cleanupPreset, entry, ce);
doCleanup(cleanupPreset, entry, panel.getDatabase(), ce);

ce.end();
if (ce.hasEdits()) {
Expand Down Expand Up @@ -155,10 +156,10 @@ private int showDialog() {
/**
* Runs the cleanup on the entry and records the change.
*/
private void doCleanup(CleanupPreset preset, BibEntry entry, NamedCompound ce) {
private void doCleanup(CleanupPreset preset, BibEntry entry, BibDatabase bibDatabase, NamedCompound ce) {
// Run cleaner
CleanupWorker cleaner = new CleanupWorker(preset,
panel.getBibDatabaseContext().getMetaData().getFileDirectory(Globals.FILE_FIELD), null,
panel.getBibDatabaseContext().getMetaData().getFileDirectory(Globals.FILE_FIELD), bibDatabase,
Globals.journalAbbreviationLoader.getRepository());
List<FieldChange> changes = cleaner.cleanup(entry);

Expand Down

0 comments on commit 3f02cfb

Please sign in to comment.