Skip to content

Commit

Permalink
Fix drag and dropping entries create a shallow copy
Browse files Browse the repository at this point in the history
  • Loading branch information
HoussemNasri committed Apr 30, 2024
1 parent dc5b413 commit 9f259c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We fixed the usage of the key binding for "Clear search" (default: <kbd>Escape</kbd>). [#10764](https://github.com/JabRef/jabref/issues/10764)
- We fixed an issue where library shown as unsaved and marked (*) after accepting changes made externally to the file. [#11027](https://github.com/JabRef/jabref/issues/11027)
- We fixed an issue where drag and dropping entries from one library to another was not always working. [#11254](https://github.com/JabRef/jabref/issues/11254)
- We fixed an issue where drag and dropping entries created a shallow copy. [#11160](https://github.com/JabRef/jabref/issues/11160)

### Removed

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/jabref/gui/frame/FrameDndHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ private void onTabDragDropped(Node destinationTabNode, DragEvent tabDragEvent, T
}

if (hasEntries(dragboard)) {
destinationLibraryTab.dropEntry(stateManager.getLocalDragboard().getBibEntries());
List<BibEntry> entryCopies = stateManager.getLocalDragboard().getBibEntries()
.stream().map(entry -> (BibEntry) entry.clone())
.toList();
destinationLibraryTab.dropEntry(entryCopies);
} else if (hasGroups(dragboard)) {
dropGroups(dragboard, destinationLibraryTab);
}
Expand Down

0 comments on commit 9f259c9

Please sign in to comment.