Revision: 6830
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6830&view=rev
Author:   hofman
Date:     2010-09-21 17:25:42 +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 17:23:30 UTC (rev 6829)
+++ trunk/NSDocument_SKExtensions.m     2010-09-21 17:25:42 UTC (rev 6830)
@@ -136,11 +136,11 @@
 
 - (NSArray *)notes { return nil; }
 
-static BOOL isRichTextType(NSString *type) {
+static BOOL isRichTextType(NSString *templateFile) {
     static NSSet *types = nil;
     if (types == nil)
         types = [[NSSet alloc] initWithObjects:@"rtf", @"doc", @"docx", 
@"odt", @"rtfd", nil];
-    return [types containsObject:type];
+    return [types containsObject:[[templateFile pathExtension] 
lowercaseString]];
 }
 
 - (NSData *)notesData {
@@ -149,9 +149,8 @@
 }
 
 - (NSString *)notesStringUsingTemplateFile:(NSString *)templateFile {
-    NSString *fileType = [[templateFile pathExtension] lowercaseString];
     NSString *string = nil;
-    if (isRichTextType(fileType) == NO) {
+    if (isRichTextType(templateFile) == 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];
@@ -162,9 +161,8 @@
 }
 
 - (NSData *)notesDataUsingTemplateFile:(NSString *)templateFile {
-    NSString *fileType = [[templateFile pathExtension] lowercaseString];
     NSData *data = nil;
-    if (isRichTextType(fileType)) {
+    if (isRichTextType(templateFile)) {
         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