Revision: 22607
          http://sourceforge.net/p/bibdesk/svn/22607
Author:   hofman
Date:     2018-09-15 09:54:08 +0000 (Sat, 15 Sep 2018)
Log Message:
-----------
Don't reuse edited category group with author, as the author won't have a pub 
and field

Modified Paths:
--------------
    trunk/bibdesk/BibDocument_Groups.m

Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m  2018-09-15 09:39:55 UTC (rev 22606)
+++ trunk/bibdesk/BibDocument_Groups.m  2018-09-15 09:54:08 UTC (rev 22607)
@@ -448,9 +448,10 @@
     for (parent in parentsToUpdate) {
         
         NSString *groupField = [parent key];
+        BOOL isPersonField = [groupField isPersonField];
         
         setAndBagContext setAndBag;
-        if([groupField isPersonField]) {
+        if(isPersonField) {
             setAndBag.set = CFSetCreateMutable(kCFAllocatorDefault, 0, 
&kBDSKAuthorFuzzySetCallBacks);
             setAndBag.bag = CFBagCreateMutable(kCFAllocatorDefault, 0, 
&kBDSKAuthorFuzzyBagCallBacks);
         } else {
@@ -483,10 +484,13 @@
         // now add the group names that we found from our BibItems, using a 
generic folder icon
         for (id groupName in (NSSet *)(setAndBag.set)) {
             NSUInteger idx = [oldGroupNames indexOfObject:groupName];
-            if (idx == NSNotFound)
+            if (idx != NSNotFound) {
+                group = [[oldGroups objectAtIndex:idx] retain];
+                if (isPersonField && [(BibAuthor *)[group name] field] == nil)
+                    BDSKDESTROY(group);
+            }
+            if (group == nil)
                 group = [[BDSKCategoryGroup alloc] initWithName:groupName 
key:groupField];
-            else
-                group = [[oldGroups objectAtIndex:idx] retain];
             [group setCount:CFBagGetCountOfValue(setAndBag.bag, groupName)];
             [mutableGroups addObject:group];
             [group release];

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

Reply via email to