From e71ad296d40ccb8be3819fd274aa5eadbbce3994 Mon Sep 17 00:00:00 2001 From: Dheeraj Singh <112228200+dhrax21@users.noreply.github.com> Date: Fri, 9 Feb 2024 21:49:37 +0530 Subject: [PATCH] BibTeX 'Title' to MS Office 'Publicationtitle' field (#10864) * #10807 BibTeX 'Title' to MS Office 'Publicationtitle' field * added_testfile_and_changelog_for_#10864 * modified_testfile_and_changelog_for_#10864 --- CHANGELOG.md | 1 + .../org/jabref/logic/msbib/MSBibConverter.java | 2 +- .../org/jabref/logic/exporter/MSBibXmlTest.bib | 16 ++++++++++++++++ .../org/jabref/logic/exporter/MSBibXmlTest.xml | 13 +++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.bib create mode 100644 src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index a7119a590bb..fefc2d328be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv ### Changed +- We Added a test case MSBibExportFormatFilesTest to ensure proper functioning of the MSBib export format.[#10864] (`https://github.com/JabRef/jabref/pull/10864/commits`) - The "Automatically open folders of attached files" preference default status has been changed to enabled on Windows. [koppor#56](https://github.com/koppor/jabref/issues/56) - The Custom export format now uses the custom DOI base URI in the preferences for the `DOICheck`, if activated [forum#4084](https://discourse.jabref.org/t/export-html-disregards-custom-doi-base-uri/4084) - The index directories for full text search have now more readable names to increase debugging possibilities using Apache Lucense's Lurk. [#10193](https://github.com/JabRef/jabref/issues/10193) diff --git a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java index d39e7bee602..6812d1033de 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java @@ -106,7 +106,7 @@ public static MSBibEntry convert(BibEntry entry) { } // TODO: currently only Misc can happen - if ("ElectronicSource".equals(msBibType) || "Art".equals(msBibType) || "Misc".equals(msBibType)) { + if ("Art".equals(msBibType) || "Misc".equals(msBibType)) { result.publicationTitle = entry.getFieldLatexFree(StandardField.TITLE).orElse(null); } diff --git a/src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.bib b/src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.bib new file mode 100644 index 00000000000..d9483a50dc8 --- /dev/null +++ b/src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.bib @@ -0,0 +1,16 @@ +% Encoding: UTF-8 + +@article{example1, + title = {Sample Article Title}, + author = {Steve, Smith}, + journal = {Journal of Examples}, + year = {2023}, + msBibType = {Art} +} + +@misc{example2, + title = {Miscellaneous Entry Title}, + author = {Doe, Jane}, + year = {2022}, + msBibType = {Misc} +} diff --git a/src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.xml b/src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.xml new file mode 100644 index 00000000000..066d2e54732 --- /dev/null +++ b/src/test/resources/org/jabref/logic/exporter/MSBibXmlTest.xml @@ -0,0 +1,13 @@ + + + + Journal Article + Sample Article Title + 2023 + + + Miscellaneous + Miscellaneous Entry Title + 2022 + +