Revision: 7512
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7512&view=rev
Author:   hofman
Date:     2011-10-08 12:48:28 +0000 (Sat, 08 Oct 2011)
Log Message:
-----------
write formatted data immediately

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

Modified: trunk/SKFormatCommand.m
===================================================================
--- trunk/SKFormatCommand.m     2011-10-08 12:32:20 UTC (rev 7511)
+++ trunk/SKFormatCommand.m     2011-10-08 12:48:28 UTC (rev 7512)
@@ -80,9 +80,8 @@
                 NSString *ext = [[[file path] pathExtension] lowercaseString];
                 if ([ext isEqualToString:@"rtfd"]) {
                     [mutableDocAttrs setObject:NSRTFDTextDocumentType 
forKey:NSDocumentTypeDocumentAttribute];
-                    [[text RTFDFileWrapperFromRange:NSMakeRange(0, [attrText 
length]) documentAttributes:mutableDocAttrs] writeToFile:[file path] 
atomically:YES updateFilenames:NO];
+                    [[attrText RTFDFileWrapperFromRange:NSMakeRange(0, 
[attrText length]) documentAttributes:mutableDocAttrs] writeToFile:[file path] 
atomically:YES updateFilenames:NO];
                 } else {
-                    NSData *data = nil;
                     NSString *docType = nil;
                     if ([ext isEqualToString:@"rtf"])
                         docType = NSRTFTextDocumentType;
@@ -96,9 +95,8 @@
                         docType = NSWebArchiveTextDocumentType;
                     if (docType) {
                         [mutableDocAttrs setObject:docType 
forKey:NSDocumentTypeDocumentAttribute];
-                        data = [attrText dataFromRange:NSMakeRange(0, 
[attrText length]) documentAttributes:mutableDocAttrs error:NULL];
+                        [[attrText dataFromRange:NSMakeRange(0, [attrText 
length]) documentAttributes:mutableDocAttrs error:NULL] writeToURL:file 
atomically:YES];
                     }
-                    [data writeToURL:file atomically:YES];
                 }
             }
         }

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


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to