Revision: 22593
          http://sourceforge.net/p/bibdesk/svn/22593
Author:   hofman
Date:     2018-09-13 15:12:16 +0000 (Thu, 13 Sep 2018)
Log Message:
-----------
cannot remove from an empty field group

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

Modified: trunk/bibdesk/BibDocument_Actions.m
===================================================================
--- trunk/bibdesk/BibDocument_Actions.m 2018-09-13 15:05:42 UTC (rev 22592)
+++ trunk/bibdesk/BibDocument_Actions.m 2018-09-13 15:12:16 UTC (rev 22593)
@@ -204,7 +204,8 @@
                 [staticGroups addObject:group];
             else if ([group groupType] == BDSKCategoryGroupType &&
                      [[group key] isSingleValuedField] == NO &&
-                     [[group key] isEqualToString:BDSKPubTypeString] == NO)
+                     [[group key] isEqualToString:BDSKPubTypeString] == NO &&
+                     [group isEmpty] == NO)
                 [categoryGroups addObject:group];
         }
         if ([staticGroups count]) {

Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m  2018-09-13 15:05:42 UTC (rev 22592)
+++ trunk/bibdesk/BibDocument_Groups.m  2018-09-13 15:12:16 UTC (rev 22593)
@@ -1317,9 +1317,11 @@
        NSString *groupName = nil;
     
     for (BDSKCategoryGroup *group in groupArray){
-               if(([group groupType] & BDSKCategoryGroupType) == 0)
-                       continue;
-               
+        if(([group groupType] & BDSKCategoryGroupType) == 0)
+            continue;
+        if([group isEmpty])
+            continue;
+
                if (groupName == nil)
                        groupName = [NSString 
stringWithFormat:NSLocalizedString(@"group %@", @"Partial status message"), 
[group name]];
                else

Modified: trunk/bibdesk/BibDocument_Menus.m
===================================================================
--- trunk/bibdesk/BibDocument_Menus.m   2018-09-13 15:05:42 UTC (rev 22592)
+++ trunk/bibdesk/BibDocument_Menus.m   2018-09-13 15:12:16 UTC (rev 22593)
@@ -126,7 +126,7 @@
     if ([self hasGroupTypeSelected:BDSKStaticGroupType])
         return YES;
     // don't remove from single valued group field, as that will clear the 
field, which is most probably a mistake. See bug # 1435344
-    if (NSNotFound != [[self selectedGroups] indexOfObjectPassingTest:^BOOL(id 
obj, NSUInteger idx, BOOL *stop){ return [obj groupType] == 
BDSKCategoryGroupType && [[obj key] isSingleValuedGroupField] == NO && [[obj 
key] isEqualToString:BDSKPubTypeString] == NO; }])
+    if (NSNotFound != [[self selectedGroups] indexOfObjectPassingTest:^BOOL(id 
obj, NSUInteger idx, BOOL *stop){ return [obj groupType] == 
BDSKCategoryGroupType && [[obj key] isSingleValuedGroupField] == NO && [[obj 
key] isEqualToString:BDSKPubTypeString] == NO && [obj isEmpty] == NO; }])
         return YES;
     return NO;
 }      

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