diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b8778bc8c7..7d941cf2a42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - Fixed NullPointerException when trying to set a special field or mark an entry through the menu without having an open database - Fixed [#1257](https://github.com/JabRef/jabref/issues/1324): Preferences for the BibTeX key generator set in a version prior to 3.2 are now migrated automatically to the new version - Fixed [#1716](https://github.com/JabRef/jabref/issues/1716): `@`-Symbols stored in BibTeX fields no longer break the database +- Fixed [#1499](https://github.com/JabRef/jabref/issues/1499): {} braces are now treated correctly in in author/editor +- Fixed [#1531](https://github.com/JabRef/jabref/issues/1531): `\relax` can be used for abbreviation of author names + ### Removed - It is not longer possible to choose to convert HTML sub- and superscripts to equations diff --git a/src/main/java/net/sf/jabref/gui/maintable/MainTableColumn.java b/src/main/java/net/sf/jabref/gui/maintable/MainTableColumn.java index bdadc4ee509..42f2c637b07 100644 --- a/src/main/java/net/sf/jabref/gui/maintable/MainTableColumn.java +++ b/src/main/java/net/sf/jabref/gui/maintable/MainTableColumn.java @@ -78,7 +78,7 @@ public String getDisplayName() { * * @return true if the bibtex fields contains author or editor */ - public boolean isNameColumn() { + private boolean isNameColumn() { for (String field : bibtexFields) { if (InternalBibtexFields.getFieldExtras(field).contains(FieldProperties.PERSON_NAMES)) { return true; @@ -129,13 +129,14 @@ public Object getColumnValue(BibEntry entry) { } } - if (content != null) { - content = toUnicode.format(content); + if (isNameColumn()) { + content = MainTableNameFormatter.formatName(content); } - if (isNameColumn()) { - return MainTableNameFormatter.formatName(content); + if (content != null) { + content = toUnicode.format(content).trim(); } + return content; } diff --git a/src/test/java/net/sf/jabref/model/entry/AuthorListTest.java b/src/test/java/net/sf/jabref/model/entry/AuthorListTest.java index 67fb4020593..d91816f6462 100644 --- a/src/test/java/net/sf/jabref/model/entry/AuthorListTest.java +++ b/src/test/java/net/sf/jabref/model/entry/AuthorListTest.java @@ -375,6 +375,28 @@ public void testGetAuthor() { Assert.assertEquals("von Neumann", author.getLastOnly()); Assert.assertEquals("Neumann, Jr, J.", author.getNameForAlphabetization()); Assert.assertEquals("von", author.getVon()); + + } + + @Test + public void testCompanyAuthor() { + Author author = AuthorList.parse("{JabRef Developers}").getAuthor(0); + Author expected = new Author(null, null, null, "JabRef Developers", null); + Assert.assertEquals(expected, author); + } + + @Test + public void testCompanyAuthorWithLowerCaseWord() { + Author author = AuthorList.parse("{JabRef Developers on Fire}").getAuthor(0); + Author expected = new Author(null, null, null, "JabRef Developers on Fire", null); + Assert.assertEquals(expected, author); + } + + @Test + public void testAbbreviationWithRelax() { + Author author = AuthorList.parse("{\\relax Ch}ristoph Cholera").getAuthor(0); + Author expected = new Author("{\\relax Ch}ristoph", "{\\relax Ch}.", null, "Cholera", null); + Assert.assertEquals(expected, author); } @Test