fixed using wrong entries for drag and drop

This commit is contained in:
michael starke
2016-10-19 11:44:23 +02:00
parent 2e1e4ad5ac
commit 0f9364e8b6
3 changed files with 8 additions and 6 deletions

View File

@@ -32,7 +32,10 @@
@implementation MPEntryTableDataSource
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {
NSArray *entries = self.viewController.entryArrayController.selectedObjects;
NSMutableArray *entries = [[NSMutableArray alloc] initWithCapacity:rowIndexes.count];
[rowIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL * _Nonnull stop) {
[entries addObject:self.viewController.entryArrayController.arrangedObjects[idx]];
}];
for(KPKEntry *entry in entries) {
if(![entry isKindOfClass:[KPKEntry class]]) {
return NO;