Revision: 27002 http://sourceforge.net/p/bibdesk/svn/27002 Author: hofman Date: 2021-10-06 14:04:43 +0000 (Wed, 06 Oct 2021) Log Message: ----------- Don't allow adding child groups of the wrong type
Modified Paths: -------------- trunk/bibdesk/BDSKParentGroup.m Modified: trunk/bibdesk/BDSKParentGroup.m =================================================================== --- trunk/bibdesk/BDSKParentGroup.m 2021-10-06 13:55:47 UTC (rev 27001) +++ trunk/bibdesk/BDSKParentGroup.m 2021-10-06 14:04:43 UTC (rev 27002) @@ -284,7 +284,7 @@ case BDSKScriptGroupType: range = NSMakeRange(scriptGroupLocation, scriptGroupCount++); break; default: - range = NSMakeRange([self numberOfChildren], 0); break; + return; } [self insertChild:group inRange:range]; } @@ -378,6 +378,8 @@ } } +- (void)addChildGroup:(BDSKGroup *)group {} + @end #pragma mark - @@ -396,6 +398,11 @@ - (BDSKGroupType)groupType { return BDSKStaticParentGroupType; } +- (void)addChildGroup:(BDSKGroup *)group { + if ([group groupType] == BDSKStaticGroupType) + [self insertChild:group inRange:NSMakeRange(0, [self numberOfChildren])]; +} + @end @@ -428,6 +435,8 @@ [self removeChild:[self childAtIndex:0]]; range = NSMakeRange(0, 0); hasLastImportGroup = YES; + } else if ([group groupType] != BDSKSmartGroupType) { + return; } else if (hasLastImportGroup) { range.location++; range.length--; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit