Revision: 12611
          http://sourceforge.net/p/skim-app/code/12611
Author:   hofman
Date:     2021-12-10 14:35:33 +0000 (Fri, 10 Dec 2021)
Log Message:
-----------
Implement rich text format class accessor in application delegate

Modified Paths:
--------------
    trunk/NSAttributedString_SKExtensions.h
    trunk/NSAttributedString_SKExtensions.m
    trunk/SKApplicationController.m

Modified: trunk/NSAttributedString_SKExtensions.h
===================================================================
--- trunk/NSAttributedString_SKExtensions.h     2021-12-10 13:54:35 UTC (rev 
12610)
+++ trunk/NSAttributedString_SKExtensions.h     2021-12-10 14:35:33 UTC (rev 
12611)
@@ -74,8 +74,3 @@
 - (void)setScriptingRTF:(id)data;
 
 @end
-
-
-@interface NSApplication (SKRichTextFormat)
-- (NSAttributedString *)valueInRichTextFormatWithName:(NSString *)name;
-@end

Modified: trunk/NSAttributedString_SKExtensions.m
===================================================================
--- trunk/NSAttributedString_SKExtensions.m     2021-12-10 13:54:35 UTC (rev 
12610)
+++ trunk/NSAttributedString_SKExtensions.m     2021-12-10 14:35:33 UTC (rev 
12611)
@@ -164,12 +164,3 @@
 
 @end
 
-
-@implementation NSApplication (SKRichTextFormat)
-
-- (NSAttributedString *)valueInRichTextFormatWithName:(NSString *)name {
-    NSData *data = [[[NSData alloc] initWithHexString:name] autorelease];
-    return data ? [[[NSAttributedString alloc] initWithData:data 
options:[NSDictionary dictionary] documentAttributes:NULL error:NULL] 
autorelease] : nil;
-}
-
-@end

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2021-12-10 13:54:35 UTC (rev 12610)
+++ trunk/SKApplicationController.m     2021-12-10 14:35:33 UTC (rev 12611)
@@ -81,6 +81,7 @@
 #import "NSCharacterSet_SKExtensions.h"
 #import "SKNotePrefs.h"
 #import "SKDisplayPrefs.h"
+#import "NSData_SKExtensions.h"
 
 #define WEBSITE_URL @"https://skim-app.sourceforge.io/";
 #define WIKI_URL    @"https://sourceforge.net/p/skim-app/wiki/";
@@ -475,7 +476,7 @@
 - (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key 
{
     static NSSet *applicationScriptingKeys = nil;
     if (applicationScriptingKeys == nil)
-        applicationScriptingKeys = [[NSSet alloc] 
initWithObjects:@"bookmarks", @"downloads", @"notePreferences", 
@"displayPreferences", @"pageBackgroundColor", @"favoriteColors", nil];
+        applicationScriptingKeys = [[NSSet alloc] 
initWithObjects:@"bookmarks", @"downloads", @"notePreferences", 
@"displayPreferences", @"richTextFormat", @"pageBackgroundColor", 
@"favoriteColors", nil];
        return [applicationScriptingKeys containsObject:key];
 }
 
@@ -536,6 +537,11 @@
     return [[[SKDisplayPrefs alloc] initWithName:name] autorelease];
 }
 
+- (NSAttributedString *)valueInRichTextFormatWithName:(NSString *)name 
{log_method();
+    NSData *data = [[[NSData alloc] initWithHexString:name] autorelease];
+    return data ? [[[NSAttributedString alloc] initWithData:data 
options:[NSDictionary dictionary] documentAttributes:NULL error:NULL] 
autorelease] : nil;
+}
+
 - (NSColor *)pageBackgroundColor {
     return [[NSUserDefaults standardUserDefaults] 
colorForKey:SKPageBackgroundColorKey] ?: [NSColor whiteColor];
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to