Skip to content

Commit

Permalink
Ms Office Export patent author as inventor (#7831)
Browse files Browse the repository at this point in the history
Fixes #7830
  • Loading branch information
Siedlerchr authored Jun 20, 2021
1 parent 38d7a30 commit 53eb463
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Changed

- The export to MS Office XML now exports the author field as `Inventor` if the bibtex entry type is `patent` [#7830](https://github.com/JabRef/jabref/issues/7830)
- We changed the EndNote importer to import the field `label` to the corresponding bibtex field `endnote-label` [forum#2734](https://discourse.jabref.org/t/importing-endnote-label-field-to-jabref-from-xml-file/2734)
- The keywords added via "Manage content selectors" are now displayed in alphabetical order. [#3791](https://github.com/JabRef/jabref/issues/3791)
- We improved the "Find unlinked files" dialog to show import results for each file. [#7209](https://github.com/JabRef/jabref/pull/7209)
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/jabref/logic/msbib/MSBibConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ public static MSBibEntry convert(BibEntry entry) {
result.publicationTitle = entry.getLatexFreeField(StandardField.TITLE).orElse(null);
}

entry.getField(StandardField.AUTHOR).ifPresent(authors -> result.authors = getAuthors(entry, authors, StandardField.AUTHOR));
if (entry.getType().equals(IEEETranEntryType.Patent)) {
entry.getField(StandardField.AUTHOR).ifPresent(authors -> result.inventors = getAuthors(entry, authors, StandardField.AUTHOR));
} else {
entry.getField(StandardField.AUTHOR).ifPresent(authors -> result.authors = getAuthors(entry, authors, StandardField.AUTHOR));
}
entry.getField(StandardField.EDITOR).ifPresent(editors -> result.editors = getAuthors(entry, editors, StandardField.EDITOR));
entry.getField(StandardField.TRANSLATOR).ifPresent(translator -> result.translators = getAuthors(entry, translator, StandardField.EDITOR));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void insertReferenceToPageNumberOfReferenceMark(XTextDocument doc,
try {
// specify that the source is a reference mark (could also be a footnote,
// bookmark or sequence field)
xFieldProps.setPropertyValue("ReferenceFieldSource", Short.valueOf(ReferenceFieldSource.REFERENCE_MARK));
xFieldProps.setPropertyValue("ReferenceFieldSource", Short.valueOf(ReferenceFieldSource.REFERENCE_MARK));
} catch (UnknownPropertyException ex) {
throw new java.lang.IllegalStateException("The created GetReference does not have property"
+ " 'ReferenceFieldSource'");
Expand All @@ -72,7 +72,7 @@ public static void insertReferenceToPageNumberOfReferenceMark(XTextDocument doc,

try {
// We want the reference displayed as page number
xFieldProps.setPropertyValue("ReferenceFieldPart", Short.valueOf(ReferenceFieldPart.PAGE));
xFieldProps.setPropertyValue("ReferenceFieldPart", Short.valueOf(ReferenceFieldPart.PAGE));
} catch (UnknownPropertyException ex) {
throw new java.lang.IllegalStateException("The created GetReference does not have property"
+ " 'ReferenceFieldPart'");
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/org/jabref/logic/exporter/MsBibPatent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<b:Title>The Vampire hunter</b:Title>
<b:Tag>Lincoln1978</b:Tag>
<b:Author>
<b:Author>
<b:Inventor>
<b:NameList>
<b:Person>
<b:Last>Lincoln</b:Last>
<b:First>Abraham</b:First>
</b:Person>
</b:NameList>
</b:Author>
</b:Inventor>
</b:Author>
<b:PatentNumber>12345677</b:PatentNumber>
</b:Source>
Expand Down

0 comments on commit 53eb463

Please sign in to comment.