Revision: 6829
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6829&view=rev
Author:   hofman
Date:     2010-09-21 17:23:30 +0000 (Tue, 21 Sep 2010)

Log Message:
-----------
small change to checking rich text template style

Modified Paths:
--------------
    trunk/NSDocument_SKExtensions.m

Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m     2010-09-21 09:44:08 UTC (rev 6828)
+++ trunk/NSDocument_SKExtensions.m     2010-09-21 17:23:30 UTC (rev 6829)
@@ -136,11 +136,11 @@
 
 - (NSArray *)notes { return nil; }
 
-static NSSet *richTextTypes() {
+static BOOL isRichTextType(NSString *type) {
     static NSSet *types = nil;
     if (types == nil)
         types = [[NSSet alloc] initWithObjects:@"rtf", @"doc", @"docx", 
@"odt", @"rtfd", nil];
-    return types;
+    return [types containsObject:type];
 }
 
 - (NSData *)notesData {
@@ -151,7 +151,7 @@
 - (NSString *)notesStringUsingTemplateFile:(NSString *)templateFile {
     NSString *fileType = [[templateFile pathExtension] lowercaseString];
     NSString *string = nil;
-    if ([richTextTypes() containsObject:fileType] == NO) {
+    if (isRichTextType(fileType) == NO) {
         NSString *templatePath = [[NSFileManager defaultManager] 
pathForApplicationSupportFile:[templateFile stringByDeletingPathExtension] 
ofType:[templateFile pathExtension] inDirectory:TEMPLATES_FOLDER_NAME];
         NSError *error = nil;
         NSString *templateString = [[NSString alloc] 
initWithContentsOfFile:templatePath encoding:NSUTF8StringEncoding error:&error];
@@ -164,7 +164,7 @@
 - (NSData *)notesDataUsingTemplateFile:(NSString *)templateFile {
     NSString *fileType = [[templateFile pathExtension] lowercaseString];
     NSData *data = nil;
-    if ([richTextTypes() containsObject:fileType]) {
+    if (isRichTextType(fileType)) {
         NSString *templatePath = [[NSFileManager defaultManager] 
pathForApplicationSupportFile:[templateFile stringByDeletingPathExtension] 
ofType:[templateFile pathExtension] inDirectory:TEMPLATES_FOLDER_NAME];
         NSDictionary *docAttributes = nil;
         NSError *error = nil;


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

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to