Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generation of multiple bibliography sections #12309

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/openoffice/OOBibBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ public void guiActionUpdateDocument(List<BibDatabase> databases, OOStyle style)
Update.SyncOptions syncOptions = new Update.SyncOptions(databases);
syncOptions
.setUpdateBibliography(true)
.setAlwaysAddCitedOnPages(this.alwaysAddCitedOnPages); // TODO: Provide option to user: this is always false
.setAlwaysAddCitedOnPages(this.alwaysAddCitedOnPages);

unresolvedKeys = Update.synchronizeDocument(doc, frontend, jStyle, fcursor.get(), syncOptions);
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

public class CSLUpdateBibliography {

private static final String CSL_BIB_SECTION_NAME = "CSL_bibliography";
private static final String BIBLIOGRAPHY_SECTION_NAME = "JR_bib";
private static final Logger LOGGER = LoggerFactory.getLogger(CSLUpdateBibliography.class);

public Optional<XTextRange> getBibliographyRange(XTextDocument doc)
throws NoDocumentException, WrappedTargetException {
LOGGER.debug("Attempting to get bibliography range");
Optional<XTextRange> range = UnoTextSection.getAnchor(doc, CSL_BIB_SECTION_NAME);
Optional<XTextRange> range = UnoTextSection.getAnchor(doc, BIBLIOGRAPHY_SECTION_NAME);
LOGGER.debug("Bibliography range found: {}", range.isPresent());
return range;
}
Expand Down Expand Up @@ -64,7 +64,7 @@ private void createCSLBibTextSection(XTextDocument doc)
LOGGER.debug("Creating new CSL bibliography section");
XTextCursor textCursor = doc.getText().createTextCursor();
textCursor.gotoEnd(false);
DocumentAnnotation annotation = new DocumentAnnotation(doc, CSL_BIB_SECTION_NAME, textCursor, false);
DocumentAnnotation annotation = new DocumentAnnotation(doc, BIBLIOGRAPHY_SECTION_NAME, textCursor, false);
UnoTextSection.create(annotation);
LOGGER.debug("CSL bibliography section created");
}
Expand Down
Loading