Revision: 5513
http://skim-app.svn.sourceforge.net/skim-app/?rev=5513&view=rev
Author: hofman
Date: 2009-07-25 16:50:41 +0000 (Sat, 25 Jul 2009)
Log Message:
-----------
run original callback if present, because the docs don't say it won't be present
Modified Paths:
--------------
trunk/SKPDFDocument.m
Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m 2009-07-23 23:52:17 UTC (rev 5512)
+++ trunk/SKPDFDocument.m 2009-07-25 16:50:41 UTC (rev 5513)
@@ -298,11 +298,27 @@
- (void)document:(NSDocument *)doc didSave:(BOOL)didSave contextInfo:(void
*)contextInfo {
docFlags.exportUsingPanel = NO;
+ if (contextInfo != NULL) {
+ NSInvocation *invocation = [(NSInvocation *)contextInfo autorelease];
+ [invocation setArgument:&doc atIndex:2];
+ [invocation setArgument:&didSave atIndex:3];
+ [invocation invoke];
+ }
}
- (void)runModalSavePanelForSaveOperation:(NSSaveOperationType)saveOperation
delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void
*)contextInfo {
// Override so we can determine if this is a save, saveAs or export
operation, so we can prepare the correct accessory view
docFlags.exportUsingPanel = (saveOperation == NSSaveToOperation);
+
+ NSInvocation *invocation = nil;
+ if (delegate && didSaveSelector) {
+ NSMethodSignature *ms = [[delegate
methodSignatureForSelector:didSaveSelector] retain];
+ invocation = [NSInvocation invocationWithMethodSignature:ms];
+ [invocation setTarget:delegate];
+ [invocation setSelector:didSaveSelector];
+ [invocation setArgument:&contextInfo atIndex:4];
+ }
+
[super runModalSavePanelForSaveOperation:saveOperation delegate:self
didSaveSelector:@selector(document:didSave:contextInfo:) contextInfo:NULL];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit