Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ Nikita Borovikov
Niklas Schmitt
nikmilpv
NikodemKch
Nikolaus Koopmann
Nils Streijffert
Niv Ierushalmi
Nivedha Sunderraj
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where the `.sav` file was not deleted upon exiting JabRef. [#6109](https://github.com/JabRef/jabref/issues/6109)
- We fixed a linked identifier icon inconsistency. [#6705](https://github.com/JabRef/jabref/issues/6705)
- We fixed the wrong behavior that font size changes are not reflected in dialogs. [#6039](https://github.com/JabRef/jabref/issues/6039)
- We fixed the failure to Copy citation key and link. [#5835](https://github.com/JabRef/jabref/issues/5835)
- We fixed an issue where the sort order of the entry table was reset after a restart of JabRef. [#6898](https://github.com/JabRef/jabref/pull/6898)
- We fixed an issue where no longer a warning was displayed when inserting references into LibreOffice with an invalid "ReferenceParagraphFormat". [#6907](https://github.com/JabRef/jabref/pull/60907).

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/jabref/gui/ClipBoardManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void addX11Support(TextInputControl input) {
// using InvalidationListener because of https://bugs.openjdk.java.net/browse/JDK-8176270
observable -> Platform.runLater(() -> {
String newValue = input.getSelectedText();
if (!newValue.isEmpty() && primary != null) {
if (!newValue.isEmpty() && (primary != null)) {
primary.setContents(new StringSelection(newValue), null);
}
}));
Expand Down Expand Up @@ -105,7 +105,7 @@ public static String getContents() {
public static String getContentsPrimary() {
if (primary != null) {
Transferable contents = primary.getContents(null);
if (contents != null && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) {
if ((contents != null) && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) {
try {
return (String) contents.getTransferData(DataFlavor.stringFlavor);
} catch (UnsupportedFlavorException | IOException e) {
Expand Down Expand Up @@ -137,9 +137,10 @@ public void setPrimaryClipboardContent(ClipboardContent content) {
}
}

public void setHtmlContent(String html) {
public void setHtmlContent(String html, String fallbackPlain) {
final ClipboardContent content = new ClipboardContent();
content.putHtml(html);
content.putString(fallbackPlain);
clipboard.setContent(content);
setPrimaryClipboardContent(content);
}
Expand Down Expand Up @@ -181,7 +182,7 @@ private List<BibEntry> handleBibTeXData(String entries) {
}

private List<BibEntry> handleStringData(String data) {
if (data == null || data.isEmpty()) {
if ((data == null) || data.isEmpty()) {
return Collections.emptyList();
}

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/jabref/gui/edit/CopyMoreAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ private void copyKeyAndLink() {
List<BibEntry> entries = stateManager.getSelectedEntries();

StringBuilder keyAndLink = new StringBuilder();
StringBuilder fallbackString = new StringBuilder();

List<BibEntry> entriesWithKey = entries.stream()
.filter(BibEntry::hasCitationKey)
Expand All @@ -222,9 +223,11 @@ private void copyKeyAndLink() {
String url = entry.getField(StandardField.URL).orElse("");
keyAndLink.append(url.isEmpty() ? key : String.format("<a href=\"%s\">%s</a>", url, key));
keyAndLink.append(OS.NEWLINE);
fallbackString.append(url.isEmpty() ? key : String.format("%s - %s", key, url));
fallbackString.append(OS.NEWLINE);
}

clipBoardManager.setHtmlContent(keyAndLink.toString());
clipBoardManager.setHtmlContent(keyAndLink.toString(), fallbackString.toString());

if (entriesWithKey.size() == entries.size()) {
// All entries had keys.
Expand Down