diff --git a/CHANGELOG.md b/CHANGELOG.md index a61f39170fe..cdbcb408629 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where JabRef icon merges with dark background [#7771](https://github.com/JabRef/jabref/issues/7771) - We fixed an issue where an entry's group was no longer highlighted on selection [#12413](https://github.com/JabRef/jabref/issues/12413) - We fixed an issue where BibTeX Strings were not included in the backup file [#12462](https://github.com/JabRef/jabref/issues/12462) +- We fixed an issue where mixing JStyle and CSL style citations in LibreOffice caused two separate bibliography sections to be generated. [#12262](https://github.com/JabRef/jabref/issues/12262) ### Removed diff --git a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java index 637c729a720..a820d7c180c 100644 --- a/src/main/java/org/jabref/gui/openoffice/OOBibBase.java +++ b/src/main/java/org/jabref/gui/openoffice/OOBibBase.java @@ -861,7 +861,7 @@ public void guiActionUpdateDocument(List 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 { diff --git a/src/main/java/org/jabref/logic/openoffice/oocsltext/CSLUpdateBibliography.java b/src/main/java/org/jabref/logic/openoffice/oocsltext/CSLUpdateBibliography.java index 732db3899ec..ab54c73e3f8 100644 --- a/src/main/java/org/jabref/logic/openoffice/oocsltext/CSLUpdateBibliography.java +++ b/src/main/java/org/jabref/logic/openoffice/oocsltext/CSLUpdateBibliography.java @@ -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 getBibliographyRange(XTextDocument doc) throws NoDocumentException, WrappedTargetException { LOGGER.debug("Attempting to get bibliography range"); - Optional range = UnoTextSection.getAnchor(doc, CSL_BIB_SECTION_NAME); + Optional range = UnoTextSection.getAnchor(doc, BIBLIOGRAPHY_SECTION_NAME); LOGGER.debug("Bibliography range found: {}", range.isPresent()); return range; } @@ -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"); }