Skip to content

Commit

Permalink
Pass database CleanupWorker constructor to enable resolving of crossr…
Browse files Browse the repository at this point in the history
…ef fields at file renaming
  • Loading branch information
koppor committed Feb 28, 2016
1 parent a3d6253 commit c4df628
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/net/sf/jabref/gui/actions/CleanupAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package net.sf.jabref.gui.actions;

import net.sf.jabref.BibDatabaseContext;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.gui.BasePanel;
Expand Down Expand Up @@ -156,9 +157,10 @@ private int showDialog() {
* Runs the cleanup on the entry and records the change.
*/
private void doCleanup(CleanupPreset preset, BibEntry entry, NamedCompound ce) {
// Run cleaner
// Create and run cleaner
BibDatabaseContext bibDatabaseContext = panel.getBibDatabaseContext();
CleanupWorker cleaner = new CleanupWorker(preset,
panel.getBibDatabaseContext().getMetaData().getFileDirectory(Globals.FILE_FIELD), null,
bibDatabaseContext.getMetaData().getFileDirectory(Globals.FILE_FIELD), bibDatabaseContext.getDatabase(),
Globals.journalAbbreviationLoader.getRepository());
List<FieldChange> changes = cleaner.cleanup(entry);

Expand Down

0 comments on commit c4df628

Please # to comment.