Revision: 29022
http://sourceforge.net/p/bibdesk/svn/29022
Author: hofman
Date: 2025-02-18 22:47:48 +0000 (Tue, 18 Feb 2025)
Log Message:
-----------
Create empty category group directly
Modified Paths:
--------------
trunk/bibdesk/BDSKCategoryGroup.h
trunk/bibdesk/BDSKCategoryGroup.m
trunk/bibdesk/BibDocument_Groups.m
Modified: trunk/bibdesk/BDSKCategoryGroup.h
===================================================================
--- trunk/bibdesk/BDSKCategoryGroup.h 2025-02-18 17:11:28 UTC (rev 29021)
+++ trunk/bibdesk/BDSKCategoryGroup.h 2025-02-18 22:47:48 UTC (rev 29022)
@@ -52,7 +52,7 @@
@param aName The name for the group, use nil for the "empty" group.
@param aKey The key for the group.
*/
-- (instancetype)initWithName:(nullable id)aName key:(NSString *)aKey;
+- (instancetype)initWithName:(id)aName key:(NSString *)aKey;
@property (nonatomic, readonly) NSString *key;
@@ -62,4 +62,8 @@
@end
+
+@interface BDSKEmptyGroup : BDSKCategoryGroup
+@end
+
NS_ASSUME_NONNULL_END
Modified: trunk/bibdesk/BDSKCategoryGroup.m
===================================================================
--- trunk/bibdesk/BDSKCategoryGroup.m 2025-02-18 17:11:28 UTC (rev 29021)
+++ trunk/bibdesk/BDSKCategoryGroup.m 2025-02-18 22:47:48 UTC (rev 29022)
@@ -47,10 +47,6 @@
#import <QuartzCore/QuartzCore.h>
-// a private subclass for the Empty ... group
-@interface BDSKEmptyGroup : BDSKCategoryGroup @end
-
-
@implementation BDSKCategoryGroup
@dynamic key, name, empty;
@@ -57,10 +53,6 @@
// designated initializer
- (instancetype)initWithName:(id)aName key:(NSString *)aKey {
- if (aName == nil) {
- self = [BDSKEmptyGroup alloc];
- aName = [aKey isPersonField] ? [BibAuthor emptyAuthor] : @"";
- }
self = [super initWithName:aName];
if (self) {
key = [aKey copy];
Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m 2025-02-18 17:11:28 UTC (rev 29021)
+++ trunk/bibdesk/BibDocument_Groups.m 2025-02-18 22:47:48 UTC (rev 29022)
@@ -513,7 +513,7 @@
if (emptyCount > 0) {
group = oldEmptyGroup;
if (group == nil)
- group = [[BDSKCategoryGroup alloc] initWithName:nil
key:groupField];
+ group = [[BDSKEmptyGroup alloc] initWithName:(isPersonField ?
[BibAuthor emptyAuthor] : @"") key:groupField];
[group setCount:emptyCount];
[mutableGroups insertObject:group atIndex:0];
}
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