Skip to content

Commit

Permalink
Allow setting the etal-string empty. Implements #1841
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed Aug 25, 2016
1 parent 2b24001 commit ac58d2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- [#1758](https://github.com/JabRef/jabref/issues/1758) Added a button to open Database Properties dialog help
- Improve focus of the maintable after a sidepane gets closed (Before it would focus the toolbar or it would focus the wrong entry)
- File open dialogs now use default extensions as primary file filter
- [#1841](https://github.com/JabRef/jabref/issues/1841) The "etal"-string in the Authors layout formatter can now be empty

### Fixed
- Fixed [#1760](https://github.com/JabRef/jabref/issues/1760): Preview updated correctly when selecting a single entry after selecting multiple entries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ else if (Authors.SEPARATORS.contains(key.trim().toLowerCase()) || Authors.LAST_S
} else if (comp(key, "LastSep") && !value.isEmpty()) {
lastSeparator = value;
}
} else if ("etal".equalsIgnoreCase(key.trim()) && !value.isEmpty()) {
} else if ("etal".equalsIgnoreCase(key.trim())) {
etAlString = value;
} else if (Authors.NUMBER_PATTERN.matcher(key.trim()).matches()) {
// Just a number:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,12 @@ public void testNoPeriod() {
Assert.assertEquals("B C Bruce, C K von Manson and J Jumper",
a.format("Bruce, Bob Croydon and Charles Kermit von Manson and Jumper, Jolly"));
}

@Test
public void testEmptyEtAl() {
ParamLayoutFormatter a = new Authors();
a.setArgument("fullname, LastFirst, Comma, 3, etal=");
Assert.assertEquals("Bruce, Bob Croydon",
a.format("Bob Croydon Bruce and Charles Manson and Jolly Jumper and Chuck Chuckles"));
}
}

0 comments on commit ac58d2c

Please sign in to comment.