Only set and use GSModalRunDelegate and GSModalRunSelector values when

not nil.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25184 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2007-05-23 13:55:10 +00:00
parent 581bae3a8d
commit 249fa82991
2 changed files with 26 additions and 13 deletions

View file

@ -1,3 +1,10 @@
2007-05-23 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSPrintOperation.m
(-runOperationModalForWindow:...contextInfo:,
-_printOperationDidRun:returnCode:contextInfo:) Only set and use
GSModalRunDelegate and GSModalRunSelector values when not nil.
2007-05-17 Riccardo Frith-Macdonald <rfm@gnu.org>
* Source/NSFont.m: Revert incorrect matrix equality test change.

View file

@ -510,19 +510,22 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
/** Run a print operation modally with respect to a window.
*/
- (void)runOperationModalForWindow: (NSWindow *)docWindow
delegate: (id)delegate
didRunSelector: (SEL)didRunSelector
contextInfo:(void *)contextInfo
delegate: (id)delegate
didRunSelector: (SEL)didRunSelector
contextInfo:(void *)contextInfo
{
NSMutableDictionary *dict;
NSPrintPanel *panel = [self printPanel];
/* Save the selector so we can use it later */
dict = [_print_info dictionary];
[dict setObject: [NSValue value: &didRunSelector withObjCType: @encode(SEL)]
forKey: @"GSModalRunSelector"];
[dict setObject: delegate
forKey: @"GSModalRunDelegate"];
if (delegate != nil && didRunSelector != NULL)
{
/* Save the selector so we can use it later */
dict = [_print_info dictionary];
[dict setObject: [NSValue value: &didRunSelector withObjCType: @encode(SEL)]
forKey: @"GSModalRunSelector"];
[dict setObject: delegate
forKey: @"GSModalRunDelegate"];
}
/* Assume we want to show the panel regardless of the value
of _showPanels
@ -701,11 +704,14 @@ static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey";
}
[self cleanUpOperation];
dict = [_print_info dictionary];
[[dict objectForKey: @"GSModalRunSelector"] getValue:&didRunSelector];
[[dict objectForKey: @"GSModalRunSelector"] getValue: &didRunSelector];
delegate = [dict objectForKey: @"GSModalRunDelegate"];
didRun = (void (*)(id, SEL, BOOL, id))[delegate methodForSelector:
didRunSelector];
didRun (delegate, didRunSelector, success, contextInfo);
if (delegate != nil && didRunSelector != NULL)
{
didRun = (void (*)(id, SEL, BOOL, id))[delegate methodForSelector:
didRunSelector];
didRun (delegate, didRunSelector, success, contextInfo);
}
}