Revision: 6577
http://skim-app.svn.sourceforge.net/skim-app/?rev=6577&view=rev
Author: hofman
Date: 2010-06-08 17:19:57 +0000 (Tue, 08 Jun 2010)
Log Message:
-----------
small changes, no need to use some local variables
Modified Paths:
--------------
trunk/SKMainDocument.m
Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m 2010-06-08 11:43:22 UTC (rev 6576)
+++ trunk/SKMainDocument.m 2010-06-08 17:19:57 UTC (rev 6577)
@@ -637,11 +637,8 @@
}
}
-- (BOOL)readFromData:(NSData *)data ofType:(NSString *)docType error:(NSError
**)outError;
-{
- BOOL didRead = NO;
+- (BOOL)readFromData:(NSData *)data ofType:(NSString *)docType error:(NSError
**)outError {
PDFDocument *pdfDoc = nil;
- NSError *error = nil;
[tmpData release];
tmpData = [[SKTemporaryData alloc] init];
@@ -657,14 +654,13 @@
if (pdfDoc) {
[self setPDFData:data];
[pdfDoc release];
- didRead = YES;
[self updateChangeCount:NSChangeDone];
+ return YES;
+ } else {
+ if (outError != NULL)
+ *outError = [NSError errorWithDomain:SKDocumentErrorDomain
code:SKReadFileError userInfo:[NSDictionary
dictionaryWithObjectsAndKeys:NSLocalizedString(@"Unable to load file", @"Error
description"), NSLocalizedDescriptionKey, nil]];
+ return NO;
}
-
- if (didRead == NO && outError != NULL)
- *outError = error ?: [NSError errorWithDomain:SKDocumentErrorDomain
code:SKReadFileError userInfo:[NSDictionary
dictionaryWithObjectsAndKeys:NSLocalizedString(@"Unable to load file", @"Error
description"), NSLocalizedDescriptionKey, nil]];
-
- return didRead;
}
static BOOL isIgnorablePOSIXError(NSError *error) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit