Skip to content

Commit

Permalink
Cited on pages... text now appears.
Browse files Browse the repository at this point in the history
Reference existing preference in OOBibBase to properly propagate
setting, so that "Cited on pages" text literal will appear when user has
it configured.

Remove accomplished TODOs.
  • Loading branch information
heyitsdross committed Sep 11, 2024
1 parent 09d9647 commit 576eb92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/jabref/gui/openoffice/OOBibBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.jabref.logic.citationstyle.CitationStyle;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.openoffice.NoDocumentFoundException;
import org.jabref.logic.openoffice.OpenOfficePreferences;
import org.jabref.logic.openoffice.action.EditInsert;
import org.jabref.logic.openoffice.action.EditMerge;
import org.jabref.logic.openoffice.action.EditSeparate;
Expand Down Expand Up @@ -68,22 +69,21 @@ public class OOBibBase {

private final DialogService dialogService;

// Shall we add "Cited on pages: ..." to resolved bibliography entries?
private final boolean alwaysAddCitedOnPages; // TODO (see comment above)
private final boolean alwaysAddCitedOnPages;

private final OOBibBaseConnect connection;

private CSLCitationOOAdapter cslCitationOOAdapter;

public OOBibBase(Path loPath, DialogService dialogService)
public OOBibBase(Path loPath, DialogService dialogService, OpenOfficePreferences openOfficePreferences)
throws
BootstrapException,
CreationException {

this.dialogService = dialogService;
this.connection = new OOBibBaseConnect(loPath, dialogService);

this.alwaysAddCitedOnPages = false;
this.alwaysAddCitedOnPages = openOfficePreferences.getAlwaysAddCitedOnPages();
}

private void initializeCitationAdapter(XTextDocument doc) throws WrappedTargetException, NoSuchElementException {
Expand Down Expand Up @@ -583,7 +583,7 @@ public void guiActionInsertEntry(List<BibEntry> entries,
}
}

syncOptions.map(e -> e.setAlwaysAddCitedOnPages(this.alwaysAddCitedOnPages)); // TODO: Provide option to user: this is always false
syncOptions.map(e -> e.setAlwaysAddCitedOnPages(this.alwaysAddCitedOnPages));

try {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ protected OOBibBase call() throws BootstrapException, CreationException {
}

private OOBibBase createBibBase(Path loPath) throws BootstrapException, CreationException {
return new OOBibBase(loPath, dialogService);
return new OOBibBase(loPath, dialogService, openOfficePreferences);
}

/**
Expand Down

0 comments on commit 576eb92

Please sign in to comment.