Revision: 28505
http://sourceforge.net/p/bibdesk/svn/28505
Author: hofman
Date: 2024-01-01 19:30:19 +0000 (Mon, 01 Jan 2024)
Log Message:
-----------
use NSHashTable to collect author names
Modified Paths:
--------------
trunk/bibdesk/BibDocument_DataSource.m
Modified: trunk/bibdesk/BibDocument_DataSource.m
===================================================================
--- trunk/bibdesk/BibDocument_DataSource.m 2024-01-01 19:14:27 UTC (rev
28504)
+++ trunk/bibdesk/BibDocument_DataSource.m 2024-01-01 19:30:19 UTC (rev
28505)
@@ -87,6 +87,7 @@
#import "BDSKGroupTextFieldCell.h"
#import "BDSKCategoryFormatter.h"
#import "BDSKControlTableCellView.h"
+#import "NSPointerFunctions_BDSKExtensions.h"
#define MAX_DRAG_IMAGE_WIDTH 700.0
@@ -1325,12 +1326,23 @@
// if dropping on the static group parent, create a new static groups
using a common author name or keyword if available
if (groupType == BDSKStaticParentGroupType) {
BibItem *pub = [pubs lastObject];
- NSMutableSet *auths = [[NSMutableSet alloc] initForFuzzyAuthors];
+ NSHashTable *auths = [[NSHashTable alloc]
initWithPointerFunctions:[NSPointerFunctions fuzzyAuthorPointerFunctions]
capacity:0];
NSHashTable *keywords = [[pub groupsForField:BDSKKeywordsString] copy];
- [auths setSet:[pub allPeople]];
+ for (NSArray *array in [[pub people] allValues]) {
+ for (BibAuthor *author in array)
+ [auths addObject:author];
+ }
for (pub in pubs) {
- [auths intersectSet:[pub allPeople]];
+ if ([auths count]) {
+ NSHashTable *pubAuths = [[NSHashTable alloc]
initWithPointerFunctions:[NSPointerFunctions fuzzyAuthorPointerFunctions]
capacity:0];
+ for (NSArray *array in [[pub people] allValues]) {
+ for (BibAuthor *author in array)
+ [pubAuths addObject:author];
+ }
+ [auths intersectHashTable:pubAuths];
+ [pubAuths release];
+ }
[keywords intersectHashTable:[pub
groupsForField:BDSKKeywordsString]];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit