Merge with gui main branch revision 39484

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@39488 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2016-03-08 21:44:29 +00:00
parent 2e68003300
commit 6360094289

View file

@ -919,24 +919,35 @@
id owner = [context objectForKey: NSNibOwner]; id owner = [context objectForKey: NSNibOwner];
id first = nil; id first = nil;
id app = nil; id app = nil;
NSCustomObject *object;
NSString *className;
// Get the file's owner and NSApplication object references... // Get the file's owner and NSApplication object references...
if ([[(NSCustomObject*)[rootObjects objectAtIndex: 1] className] isEqualToString: @"FirstResponder"]) object = (NSCustomObject*)[rootObjects objectAtIndex: 1];
first = [(NSCustomObject*)[rootObjects objectAtIndex: 1] realObject]; if ([[object className] isEqualToString: @"FirstResponder"])
{
first = [object realObject];
}
else else
{
NSLog(@"%s:first responder missing\n", __PRETTY_FUNCTION__); NSLog(@"%s:first responder missing\n", __PRETTY_FUNCTION__);
}
id object = [rootObjects objectAtIndex: 2]; object = (NSCustomObject*)[rootObjects objectAtIndex: 2];
NSString *className = [(NSCustomObject*)object className]; className = [object className];
Class theClass = NSClassFromString(className); if ([className isEqualToString: @"NSApplication"] ||
BOOL isAppClass = [theClass isSubclassOfClass:[NSApplication class]]; [NSClassFromString(className) isSubclassOfClass:[NSApplication class]])
if (isAppClass) {
app = [(NSCustomObject*)[rootObjects objectAtIndex: 2] realObject]; app = [object realObject];
}
else else
NSLog(@"%s:NSApplication missing\n", __PRETTY_FUNCTION__); {
NSLog(@"%s:NSApplication missing '%@'\n", __PRETTY_FUNCTION__, className);
}
// Use the owner as first root object // Use the owner as first root object
[(NSCustomObject*)[rootObjects objectAtIndex: 0] setRealObject: owner]; [(NSCustomObject*)[rootObjects objectAtIndex: 0] setRealObject: owner];
en = [rootObjects objectEnumerator]; en = [rootObjects objectEnumerator];
while ((obj = [en nextObject]) != nil) while ((obj = [en nextObject]) != nil)
{ {