Revision: 4111
http://skim-app.svn.sourceforge.net/skim-app/?rev=4111&view=rev
Author: hofman
Date: 2008-06-30 10:57:01 -0700 (Mon, 30 Jun 2008)
Log Message:
-----------
Don't check whether document responds to 10.5-only method, because we override
the method, so the check will always be true. Instead check the AppKit version.
Modified Paths:
--------------
trunk/SKPDFDocument.m
Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m 2008-06-30 09:41:49 UTC (rev 4110)
+++ trunk/SKPDFDocument.m 2008-06-30 17:57:01 UTC (rev 4111)
@@ -225,12 +225,19 @@
}
- (NSString *)fileNameExtensionForType:(NSString *)typeName
saveOperation:(NSSaveOperationType)saveOperation {
- // this will never be called on 10.4, so we can safely call super
- NSString *fileExtension = [super fileNameExtensionForType:typeName
saveOperation:saveOperation];
- if (fileExtension == nil) {
- if ([[[NSDocumentController sharedDocumentController]
customExportTemplateFiles] containsObject:typeName])
- fileExtension = [typeName pathExtension];
- }
+ NSString *fileExtension = nil;
+ // this should never be called on 10.4, but just make sure
+ if ([[SKPDFDocument superclass] instancesRespondToSelector:_cmd]) {
+ fileExtension = [super fileNameExtensionForType:typeName
saveOperation:saveOperation];
+ if (fileExtension == nil) {
+ if ([[[NSDocumentController sharedDocumentController]
customExportTemplateFiles] containsObject:typeName])
+ fileExtension = [typeName pathExtension];
+ }
+ } else {
+ NSArray *fileExtensions = [[NSDocumentController
sharedDocumentController] fileExtensionsFromType:typeName];
+ if ([fileExtensions count])
+ fileExtension = [fileExtensions objectAtIndex:0];
+ }
return fileExtension;
}
@@ -250,7 +257,7 @@
[formatPopup selectItemAtIndex:idx];
[formatPopup sendAction:[formatPopup action]
to:[formatPopup target]];
NSArray *fileTypes = nil;
- if ([self
respondsToSelector:@selector(fileNameExtensionForType:saveOperation:)])
+ if (NSAppKitVersionNumber > NSAppKitVersionNumber10_4)
fileTypes = [NSArray arrayWithObjects:[self
fileNameExtensionForType:lastExportedType saveOperation:NSSaveToOperation],
nil];
else
fileTypes = [[NSDocumentController
sharedDocumentController] fileExtensionsFromType:lastExportedType];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit