Revision: 29849
http://sourceforge.net/p/bibdesk/svn/29849
Author: hofman
Date: 2025-11-19 15:29:59 +0000 (Wed, 19 Nov 2025)
Log Message:
-----------
improve some types
Modified Paths:
--------------
trunk/bibdesk/BDSKToken.h
trunk/bibdesk/BDSKToken.m
Modified: trunk/bibdesk/BDSKToken.h
===================================================================
--- trunk/bibdesk/BDSKToken.h 2025-11-18 23:01:35 UTC (rev 29848)
+++ trunk/bibdesk/BDSKToken.h 2025-11-19 15:29:59 UTC (rev 29849)
@@ -57,8 +57,8 @@
BOOL inRepository;
NSString *fontName;
CGFloat fontSize;
- NSInteger bold;
- NSInteger italic;
+ NSControlStateValue bold;
+ NSControlStateValue italic;
}
+ (instancetype)tokenWithField:(NSString *)field;
@@ -76,10 +76,10 @@
@property (nonatomic, nullable, strong) NSString *fontName;
@property (nonatomic) CGFloat fontSize;
-@property (nonatomic) NSInteger bold;
-@property (nonatomic) NSInteger italic;
+@property (nonatomic) NSControlStateValue bold;
+@property (nonatomic) NSControlStateValue italic;
-@property (nonatomic, nullable, readonly) NSString *string;
+@property (nonatomic, readonly) NSString *string;
- (nullable NSAttributedString
*)attributedStringWithDefaultAttributes:(NSDictionary *)attributes;
Modified: trunk/bibdesk/BDSKToken.m
===================================================================
--- trunk/bibdesk/BDSKToken.m 2025-11-18 23:01:35 UTC (rev 29848)
+++ trunk/bibdesk/BDSKToken.m 2025-11-19 15:29:59 UTC (rev 29849)
@@ -137,6 +137,7 @@
fontSize = [decoder decodeDoubleForKey:FONTSIZE_KEY];
bold = [decoder decodeIntegerForKey:BOLD_KEY];
italic = [decoder decodeIntegerForKey:ITALIC_KEY];
+ inRepository = NO;
}
return self;
}
@@ -179,7 +180,7 @@
}
- (NSString *)string {
- return nil;
+ return @"";
}
- (NSString *)boxTitle {
@@ -191,7 +192,7 @@
NSAttributedString *attrString = nil;
NSMutableDictionary *attrs = [attributes mutableCopy];
NSFont *font = [attrs objectForKey:NSFontAttributeName];
- NSInteger traits = [fm traitsOfFont:font];
+ NSFontTraitMask traits = [fm traitsOfFont:font];
BOOL wasBold = (traits & NSBoldFontMask) != 0;
BOOL wasItalic = (traits & NSItalicFontMask) != 0;
BOOL useBold = bold == NSControlStateValueMixed ? wasBold : bold;
@@ -997,8 +998,6 @@
}
- (void)setTitle:(NSString *)newTitle {
- if (newTitle == nil)
- newTitle = @"";
if (title != newTitle) {
title = newTitle;
}
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